- Roland Smith
- PowerBuilder
- Friday, 10 May 2019 02:55 PM UTC
PB 2017-R3 and SQL Server 2017 Express using ODBC connection.
I am able to run a stored procedure with output parameter using RPCFUNC but for some reason my client doesn't want to do it that way. When I attempt to code a DECLARE, I get a compile error when I add the OUTPUT clause and if I tell it to ignore the error, the program just disappears when I click the button.
Here is the error message:
SQLSTATE = 37000[Microsoft][SQL Server Native Client 11.0] Syntax error, permission violation, or other nonspecific error.
Here is the RPCFUNC declaration:
Function long sproc_assignuid ( Ref string cretvalue, long bfromfront ) RPCFunc Alias For "dbo.vsp_am_assignuid"
Here is my declare code:
Long ll_bFromFront
String ls_cRetValue
DECLARE sproc_assignuid PROCEDURE FOR dbo.vsp_am_assignuid
@cretvalue = :ls_cRetValue OUTPUT,
@bfromfront = :ll_bFromFront;
ls_cRetValue = Space(15)
EXECUTE sproc_assignuid;
If sqlca.SQLCode
MessageBox( "Error Calling vsp_am_assignuid", &
sqlca.SQLErrText, StopSign!)
Return
End If
FETCH sproc_assignuid INTO :ls_cRetValue;
CLOSE sproc_assignuid;
MessageBox("ls_cRetValue", ls_cRetValue)
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.