Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- From: "Betsy" <betsy.a.tainer@xxxxxxxxxxxxx>
- Date: Wed, 27 Apr 2005 11:38:03 -0700
forgot my stuff:
here's the stored proc as it exists at this moment:
CREATE PROCEDURE dbo.getPayments @meetingCode char(6), @guestid char(10) AS
select sum(a.amount) as total from dbo.payments a
where (A.meetingCode= @meetingCode) and (a.guestid = @guestid)
GO
here's the call: (no giggling if you please! I've been slapping it around a
bit!)
function Tdm.GetPayments: currency;
begin
if adodsMeeting.Active then
begin
with adosp do
begin
Close;
prepared := false;
Parameters.Clear;
procedurename := 'getPayments';
// Parameters.CreateParameter('guestID',ftString, pdInput, 10,
trim(adodsGuests.Fieldbyname('guestid').AsString));
// Parameters.CreateParameter('meetingCode',ftString, pdInput, 6,
adodsGuests.Fieldbyname('meetingCode').AsString);
Parameters.Refresh;
Parameters.ParamByName('@guestid').Value :=
trim(adodsGuests.Fieldbyname('guestid').AsString);
Parameters.ParamByName('@meetingCode').Value :=
trim(adodsGuests.Fieldbyname('meetingCode').AsString);
prepared := true;
adosp.Open; //here is where I get the access violation
First;
if RecordCount > 0 then //it is seeing a record returned (1)
that's progress
result := fieldbyname('total').AsCurrency //however not getting a
value
else
result := 0;
end;
end;
end;
"Brian Bushay TeamB" <BBushay@xxxxxxxxx> wrote in message
news:mnot61hm7i824558ruop7o07tli3jv5s2a@xxxxxxxxxx
>
> >so... here I have a stored procedure...
> >
> >CREATE PROCEDURE dbo.getPayments @meetingCode char(6), @guestid char(10)
AS
> >return (select sum(a.amount) as payments from dbo.payments a
> >where (A.meetingCode= @meetingCode) and (a.guestid = @guestid)
> >group by a.guestid
> >)
> >GO
>
> The parameter is @Return_value and don't create your parameters
> just call Parameters.refresh
> --
> Brian Bushay (TeamB)
> Bbushay@xxxxxxxxx
.
- Follow-Ups:
- Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- From: Brian Bushay TeamB
- Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- From: Ron
- Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- References:
- stored proc RETURN_VALUE.... there it is, I want to use it !!!
- From: Betsy
- Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- From: Brian Bushay TeamB
- stored proc RETURN_VALUE.... there it is, I want to use it !!!
- Prev by Date: Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- Next by Date: Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- Previous by thread: Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- Next by thread: Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- Index(es):