Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How Do I Create This Procedure?
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
01116731
Message ID:
01116775
Views:
27
nResult = SQLEXEC(iConnHandle, "EXEC sp_GenerateSystemId ?cKey, ?@nId")
>Ok, this just isn't working. It should be simple.
>
>Again, here's the SQL code. There are 2 params.
>
>
>CREATE PROCEDURE sp_GenerateSystemId
> @key_name varchar(50),
> @newID int OUTPUT
>AS
>
>SET NOCOUNT ON
>
>UPDATE System_Keys
>SET
> id = id + 1
>WHERE
> key_name = @key_name
>
>IF @@ERROR <> 0
> RETURN 0
>ELSE
> RETURN -1
>
>
>And here's my code:
>
>
>sSqlConnStr = "DRIVER=SQL Server;SERVER=dserver3;database=newmegadb;uid=sa;password="
>
>iConnHandle = SQLSTRINGCONNECT(sSqlConnStr)
>
>IF iConnHandle > 0
>
>	cKey = "key_name"
>	nId = 0
>	nResult = SQLEXEC(iConnHandle, "EXEC sp_GenerateSystemId ?@cKey, ?@nId")
>
>	IF nResult < 0
>		AERROR(aErrInfo)
>		MESSAGEBOX(aErrInfo[2],48)
>	ELSE
>		? nId
>	ENDIF
>
>	SQLDISCONNECT(iConnHandle)
>	
>ELSE
>	? "Not connected"
>ENDIF
>
>
>SQL is returning 'Formal parameter '@key_name' was defined as OUTPUT but the actual
>parameter not declared OUTPUT.'
>
>I don't see how 'key_name' was defined as output???
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform