Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro Substitution
Message
 
 
À
17/10/2005 16:04:30
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
01059687
Message ID:
01059719
Vues:
12
lcString = "EXEC ACC_usp_Next_Number 'ACC_NOC', 'iNOC_id', ?@lnLastNumber"
>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.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform