I am calling one stored procedure from the Navision thru the ADO command. the procedure is containing the input and output both parameters. inside the procedure, I have written the update statement and sending a string through output parameters. but inside the Navision, I am not getting the output string. however, the stored procedure is getting executed successfully. if I am removing the update statement from the procedure then able to read the output string.
---Sending output parameters to the procedure
ADOParameter:=ADOCommand.CreateParameter('@success',200,2,100,'');
ADOCommand.Parameters.Append(ADOParameter);
ADOParameter:=ADOCommand.CreateParameter('@msg',200,2,100,'');
ADOCommand.Parameters.Append(ADOParameter);
---fetching output parameters from the procedure
ltxtResult := FORMAT(ADOCommand.Parameters.Item('@msg').Value);
MESSAGE(ltxtResult);
ltxtResult := FORMAT(ADOCommand.Parameters.Item('@success').Value);
MESSAGE(ltxtResult);
Hi,
Can you please mark which one is output parameter in the code?
Thanks.
Hi Nitin,
ltxtConnectionString := 'Driver={SQL Server};PROVIDER=SQLOLEDB;SERVER=10.10.0.***' +
';DATABASE=OperationProcess;UID=****;PWD=********';
IF ISCLEAR(ADOConnection) THEN
CREATE(ADOConnection,FALSE,TRUE);
ADOConnection.ConnectionString:= ltxtConnectionString;
ADOConnection.Open;
IF ISCLEAR(ADOCommand) THEN
CREATE(ADOCommand,FALSE,TRUE);
VarActiveConnection := ADOConnection;
ADOCommand.ActiveConnection := VarActiveConnection;
ADOCommand.CommandText := 'OperationProcess.dbo.spr_Requisition_CreateTemplateDineInMenu';
ADOCommand.CommandType := 4;
ADOCommand.CommandTimeout := 0;
ADOParameter:=ADOCommand.CreateParameter('@CommissaryLocation',200,1,100,CommissaryLocation);
ADOCommand.Parameters.Append(ADOParameter);
ADOParameter:=ADOCommand.CreateParameter('@OutletList',200,1,100,OutletList);
ADOCommand.Parameters.Append(ADOParameter);
ADOParameter:=ADOCommand.CreateParameter('@ProductionBOM',200,1,100,ProductionBOM);
ADOCommand.Parameters.Append(ADOParameter);
ADOParameter:=ADOCommand.CreateParameter('@success',200,2,100,'');
ADOCommand.Parameters.Append(ADOParameter);
ADOParameter:=ADOCommand.CreateParameter('@msg',200,2,100,'');
ADOCommand.Parameters.Append(ADOParameter);
ADOCommand.Execute;
ltxtResult := FORMAT(ADOCommand.Parameters.Item('@msg').Value);
MESSAGE(ltxtResult);
ltxtResult := FORMAT(ADOCommand.Parameters.Item('@success').Value);
MESSAGE(ltxtResult);
ADOConnection.Close;
CLEAR(ADOConnection);
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156