Hello!
I have the problem that I have to call the MS SQL Server stored procedure sp_set_session_context to set a context variable. Unfortunately this does not work with the PowerServer.
The PowerServer always gives me the message
'PowerServer.Api.ServerApiController.ImmediateExecute (PowerServer.Api)' get result (
{
"IsSuccess": false,
"RequestId": null,
"AppName": "OV",
"NameSpace": "OV",
"ErrorCode": 0,
"ErrorMessage": "Failed to parse the statement 'EXEC sp_set_session_context N'username', N'apeters'': The function or stored procedure might not exist."
}).
The call is no problem with Powerbuilder. I have also tried various variations, unfortunately all without success.
ls_sql = "EXEC sys.sp_set_session_context N'" + as_key + "', N'" + as_value + "';"
EXECUTE IMMEDIATE :ls_sql USING THIS;
alternative
DECLARE usp_createproc PROCEDURE FOR sys.sp_set_session_context
key=:as_key, value=:as_value USING THIS;
EXECUTE usp_createproc;
How can I actually solve my problem?
I am using PowerBuilder / PowerServer version 22.0.0.1892
Thanks for the help
Alex