Try OpenEdge Now
skip to main content
SQL Development
Stored Procedures and Triggers : Writing stored procedures : Invoking stored procedures : From ODBC
 
From ODBC
From ODBC, applications use the syntax in the following ODBC call escape sequence:
Syntax
{ CALL proc_name[(parameter[ , ...])]} ;
Use parameter markers (question marks used as placeholders) for input or output parameters to the procedure. You can also use literal values for input parameters only. OpenEdge stored procedures do not support return values in the ODBC escape sequence.
Embed the escape sequence in an ODBC SQLExecDirect call to execute the procedure.
Example: Stored procedure passing a single output parameter
The following example shows a call to a stored procedure named order_parts that passes a single input parameter using a parameter marker.
SQLUINTEGER Part_num;
SQLINTEGER Part_numInd = 0;
// Bind the parameter.
SQLBindParameter (hstmt, 1, SQL_PARAM_INPUT,
SQL_C_SLONG, SQL_INTEGER,
0, 0, &Part_num, 0, Part_numInd);
// Place the department number in Part_num.
Part_num = 318;
// Execute the statement.
SQLExecDirect(hstmt, "{ call order_parts(?) } ", SQL_NTS);