Stored procedure output parameter returning no value

Posted by 9899 on 12-Apr-2019 12:21

Hello All,

I am trying to run below  progress 4gl sample code to use SQL server stored procedure. I am using  ODBC connection for communication between SQL server and open edge.

Connection is working well and I am able to access SQL data in my progress procedure but the output parameter returns no value.

/*************************************************Progress Sample Code ****************************************************/

run stored-procedure spGetTopStudents load-result-into hTable (input piPageNum ,                                                                                     input piNoOfRows,                                                                                     output piCount).

/********************************************************************************************************************************/

Result: piCount = 0

Below is the definition of SQL stored procedure I am calling in my progress procedure.

/*************************************************************Stored Procedure Definition**********************************************/

ALTER PROCEDURE [dbo].[spGetTopStudents ]
                       @ipPageNo integer,
                       @ipNoOfPages integer,
                       @iCount INTEGER OUTPUT  /* Note - This is the parameter I am expecting to be                                                                                                                                             returned as a output in my progress code. */

/*******************************************************************************************************************************************/

Please suggest  something on this.

All Replies

Posted by Fernando Souza on 05-Jun-2019 13:52

For stored-procedures via the DataServer, you won't get the output values in a variable like you do for ABL procedures. The value will be returned via the field in the pseudo-table created for the stored-procedure in the schema holder.

So assuming the name of the parameter matches the name in the schema holder definition, you would get the value via spGetTopStudents.iCount.

This thread is closed