BAM1979 Posted February 7, 2008 Share Posted February 7, 2008 I am using php odbc functions to connect to a MSSQL db and run stored procedures. usually, the procedures i use return record sets which are easy enough to extract data from using odbc_fetch_row() odbc_result() etc.. Unfortunately i have been given a set of stored procedures that return variables intead of record sets. i have been going through the odbc functions in the php manual and cant for the life of me figure out how to access them. obviously fetch_row and _result dont work and neither does anything else. i always seem to get "No tuples available at this result index". i understand why this is so, but cant figue out the correct way to access the data... any ideas or advice would be well and truly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/89899-retrieve-variables-from-stored-mssql-procedures/ Share on other sites More sharing options...
pestilence669 Posted April 14, 2008 Share Posted April 14, 2008 Nothing should be stopping you from entering TSQL directly into your ODBC call. IIRC, you define your variables, call your stored procedure, then SELECT a row back out. It looks something like: DECLARE @foo1 INT DECLARE @foo2 INT CALL fooProc(@foo1, @foo2) SELECT @foo1 AS foo1, @foo2 AS foo2 Sorry if there's a syntax error. It's been awhile, but the idea is the same. Quote Link to comment https://forums.phpfreaks.com/topic/89899-retrieve-variables-from-stored-mssql-procedures/#findComment-516497 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.