Skip to Content.
Sympa Menu

freetds - RE: [freetds] dbrpcsend fails (works now, BUT THERE IS MORE)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Polyanovskyi, Sasha" <sasha.polyanovskyi AT oa.com.au>
  • To: 'FreeTDS Development Group' <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] dbrpcsend fails (works now, BUT THERE IS MORE)
  • Date: Wed, 24 Mar 2004 12:16:38 +1100

Sorry, another question :-)

For some reason the following two procedures work differently... The first
one needs TWO calls to dbresults() to process columns, return values, and
return status, whilst the second one -- needs THREE calls to dbresults().

The first case works as expected... In the second case I need to do TWO
calls to dbresults() at the beginning (instead of the expected ONE call),
then process columns, then do another call to dbresults(), then process
return values...

The difference between the procedures is the order of the first two
statements in the procedure body

_________________________________________

CREATE PROCEDURE myProc
(
@total int OUTPUT
)
AS
BEGIN
select * from indial

SELECT @total = COUNT(*) from service

declare @sum int
set @sum = @total + 5
return @sum
END

_________________________________________


CREATE PROCEDURE myProc
(
@total int OUTPUT
)
AS
BEGIN
SELECT @total = COUNT(*) from service

select * from indial

declare @sum int
set @sum = @total + 5
return @sum
END




Archive powered by MHonArc 2.6.24.

Top of Page