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 < 0 Then
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)