Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- From: "Betsy" <betsy.a.tainer@xxxxxxxxxxxxx>
- Date: Tue, 26 Apr 2005 16:53:55 -0700
OH... I'm having a '#@!!' of a time... (ps looks like it likes RETURN...
doesn't like RETURN()... but thanx... getting closer)
I can't seem to get a result out of this stored proc... can you take another
look for me. I've done this loads of times... don't you hate it when
something that should take you 5 minutes takes all afternoon... I should
just go home now!
I've changed stuff trying to make it work... using a stored proc component
now vs dataset...
code:
adosp.Close;
adosp.prepared := false;
adosp.procedurename := 'getCost';
adosp.Parameters.Clear;
//is this part right????
adosp.Parameters.CreateParameter('RESULT_VALUE',ftCurrency,
pdReturnValue, 10, 0);
ADOSP.Parameters.CreateParameter('guestID',ftString, pdInput, 10,
trim(adodsGuests.FieldValues['guestid']));
ADOSP.Parameters.CreateParameter('meetingCode',ftString, pdInput, 6,
trim(adodsGuests.FieldValues['meetingCode']));
ADOSP.prepared := true;
ADOSP.Open;
//how about this???
result := adosp.Parameters.ParamValues['RESULT_VALUE'];
stored proc:
CREATE PROCEDURE dbo.getCost @meetingCode char(6), @guestID char(10) AS
SELECT sum (A.Cost * W.Factor) AS cost
FROM dbo.who W, dbo.Events E, dbo.Activity A
WHERE (A.meetingCode = @meetingCode) and (E.[GuestID] = @guestID) AND (E.Who
= W.Who) AND (A.meetingCode = E.meetingCode)
AND (A.[activityCode] = E.[activityCode]) AND (A.[billingCode] = 'P')
RETURN
GO
I don't seem to be getting anything out of the stored proc... I've hooked a
grid into it so I can snoop and it shows the field name for the response but
no value... I'm going to get violent with it here pretty soon... thanx for
the help.
b
"Patrick" <pdc@xxxxxxxxxxxxxxxxxxx> wrote in message
news:426eb05d$1@xxxxxxxxxxxxxxxxxxxxxxxxx
> > I saw in the
> > sql help that it states that stored procedures don't return values???
But
> > then I see that there is the 'return' ?call? available that is suppose
to
> > return a value...???
> In MS-SQL, you call RETURN() to send a return value. (Right before the GO)
>
>
.
- Follow-Ups:
- Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- From: Marc Scheuner
- Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- From: Marc Scheuner
- Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- References:
- Prev by Date: Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- Next by Date: MySQL, ADO and ODBC
- 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):