I execute this query with php and odbc driver
$sql="DECLARE @Auftrag int;
DECLARE @date_now datetime = getdate();
EXEC @Auftrag=EHS.dbo.SP_ANZEIGE
@Tablet=1,
@Status=0,
@KuNr='K015538';
SELECT 'generatedID'=@Auftrag;";
$res = odbc_exec($db1_link, $sql) or die(odbc_errormsg()); // returns resource(13)
$firstRow = odbc_fetch_array($res); // dies error
If i do odbc_fetch_array the error "No tuples available at this result index" is thrown.
If I run the exact same query in Management Studio everything works fine. It shows me the computed generatedID. What is the difference?
greets Alex
Try to prefix the query with:
set nocount on
That prevents SQL Server from sending rowcount updates, which UNIX clients sometimes mistake for actual rowsets
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With