PHP+ODBC - Get return value from stored procedure
I need to use some old procedures, which return a status code. Rewriting procedures or rewriting PHP to use native driver is not possible 开发者_如何学JAVAfor now.
Is it possible to get the return value? If so, how ?
The underlying database is MS SQL 2008. I'm calling the stored procedure using this:
$res = odbc_execute( "EXEC procedure_name @param = 'value', ..." );
A very old question, but I have just had to solve it by trial and error. If the stored procedure is programmed to return a value, then it can be obtained via the usual odbc call:
$results = odbc_fetch_row ($res);
Then determine the structure of the returned array via:
var_dump ($results);
精彩评论