Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro Substitution
Message
From
17/10/2005 16:04:30
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
01059687
Message ID:
01059715
Views:
11
Thanks Sergey,

This is what I have now in the stored procedure:

CREATE PROCEDURE ACC_usp_Next_Number @cTableName char(40),@cKey AS CHAR(40),@iNext int OUTPUT AS

DECLARE @ret_ext_max nvarchar(100), @cSQLString nvarchar(100)

SET @cSQLString = N'SELECT @ret_ext_max = MAX('+@cKey+') FROM '+RTRIM(@cTableName)

EXEC sp_executesql @cSQLString, N'@ret_ext_max nvarchar(100) OUTPUT',
@ret_ext_max OUTPUT

SET @iNext = @ret_ext_max

PRINT @iNext
------------------------------------------------------------

*-- When I run it from the query analyser it prints the right number, BUT when I called it from Foxpro the return parameter stays the same. This is the way I call it from Foxpro:

LOCAL lnExecutionSuccess,lcString,lnLastNumber

lnLastNumber = 0

lcString = "{CALL ACC_usp_Next_Number ('ACC_NOC','iNOC_id',?@lnLastNumber)}"

lnExecutionSuccess = SQLExec(oApp.nConnectionHandle,lcString)

*-- Basically lnLastNumber always stays as 0


Do you know why this is happening?

Thanks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform