RETURN_VALUES ??? done... What have I gained?
- From: "Betsy" <betsy.a.tainer@xxxxxxxxxxxxx>
- Date: Thu, 5 May 2005 15:38:40 -0700
General question...
-using an ADOSTOREDPROC component... is there any reason why I should use
something else, say ADOQuery ???? With adodataset I was getting an error
about a result set and didn't see anywhere where I had the opportunity to
Execproc vs Open... (did I miss something there?)
-the only advantage I see is that I'm not trying to return a dataset when
all I need is a stinkin value, amount, string, what-have-you... there is
nothing especially clean and simple about it... so... (the question)
(FINALLY!)... Did I really gain anything??? (other then some tiny sense of
accomplishment)
That is a serious question by the way... is it somehow more effecient to
retrieve one value/result when that is all you need?
***for the inquiring mind***
stored proc:
CREATE PROCEDURE dbo.getPayments @meetingCode char(6), @guestID char(10),
@total money OUTPUT AS
/* used to retreive the payments made by a member*/
select @total = sum(amount)
from payments
where (meetingCode= @meetingCode) and (guestid = @guestid)
RETURN
GO
call in a function:
function Tdm.GetPayments: currency;
begin
result := 0.00; //default
if adodsMeeting.Active then //a meeting is opened
begin
with ADOSP do
begin
close;
Prepared := false;
Parameters.Clear;
ProcedureName := 'getPayments';
Parameters.CreateParameter('meetingCode',ftString,pdInput,6,
trim(adodsGuests.Fieldbyname('meetingCode').AsString));
Parameters.CreateParameter('guestID',ftString,pdInput,10,
trim(adodsGuests.Fieldbyname('guestid').AsString));
Parameters.CreateParameter('total',ftCurrency,pdOutput,10,0);
prepared := true;
ExecProc;
if varisnull(Parameters.ParamByName('total').Value) then
result := 0.00
else
result := Parameters.ParamByName('total').Value;
end;
end;
end;
ps... thanx Ron noone@xxxxxxxxxxxxxx your notes helped tremendously... I
find microsoft help to be a little criptic.
.
- Follow-Ups:
- Re: RETURN_VALUES ??? done... What have I gained?
- From: Brian Bushay TeamB
- Re: RETURN_VALUES ??? done... What have I gained?
- From: Del M
- Re: RETURN_VALUES ??? done... What have I gained?
- Prev by Date: Re: Problem updating Excel using ADO
- Next by Date: Re: RETURN_VALUES ??? done... What have I gained?
- Previous by thread: Application error leaving D7
- Next by thread: Re: RETURN_VALUES ??? done... What have I gained?
- Index(es):