Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!
- From: "Betsy" <betsy.a.tainer@xxxxxxxxxxxxx>
- Date: Wed, 27 Apr 2005 14:44:50 -0700
SEVERELY STUMPED...
I've started a whole new project... eliminate absolutely everything but this
one stored procedure... nothing...
it appears to run okay... returns field heading for the return value... no
value... regardless of what I tell it to do...
skip the sum(amount)... just give * (every flipping thing)... same thing...
field headings... no values...
hard-code the guestid and meeting code... same thing...
take the guts of the stored proc with hard coded guestid and meeting code
and run it as a normal sql statement in the enterprise manager... all is
well... I'm at a total loss. This is such a basic thing and I've done it
over and over again... I don't understand why it's not working.
HELP!
ideas? authorities... ??? all appears to be okay... signon as dbo... so
should have authority... no errors....
b
"Betsy" <betsy.a.tainer@xxxxxxxxxxxxx> wrote in message
news:426eab87$1@xxxxxxxxxxxxxxxxxxxxxxxxx
> 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
>
> here I call it...
> with ADODataSet1 do
> begin
> prepared := false;
> CommandType := cmdStoredProc;
> CommandText := 'getPayments';
> Parameters.CreateParameter('guestID',ftString, pdInput, 10,
> adodsGuests.FieldValues['guestid']);
> Parameters.CreateParameter('meetingCode',ftString, pdInput, 6,
> adodsGuests.FieldValues['meetingCode']);
> Parameters.CreateParameter('RETURN_VALUE',ftCurrency, pdOutput, 4,
0);
> prepared := true;
> open;
> getPayments := Parameters.ParamByName('RETURN_VALUE').Value;
> close;
> end;
>
> I'm anticipating the 'return' of the stored proc to be available in the
> 'RETURN_VALUE' of the dataset parameter.
>
> ***
> I know that I could just run it and read the resulting fieldvalue... never
> mind all of this return() and return_value business... but I saw it there
> and want to use it (whine!). Am I just not thinking clearly? 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...??? and I see the 'RETURN_VALUE' output parameter that
just
> kind of plunks itself there whenever you use a stored procedure... and I'm
> thinking... here's a handy little gizmo, I should figure out how to make
use
> of it... failing miserably... can anyone set me straight?
>
> AND... how come when I plunk down a stored procedure or set my dataset
> component to call a stored procedure that it knows the parameters BUT when
I
> change the name of the stored procedure during runtime I have to 'create'
> the parameters? Am I missing something there as well? (whine again...
they
> need to turn on the air conditioning here, sorry!)
>
> thanx much!
> b
>
>
.
- Follow-Ups:
- References:
- 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):
Relevant Pages
|