Getting 4004 SQL Server error after execution of stored procedure with JSON input using PHP code

29
January 12, 2019, at 11:40 AM

We created a stored procedure in SQL server which takes input parameter as JSON. Procedure is giving us results in JSON in the studio management. But, it is giving 4004 SQL server error after executing the procedure using PHP code. We are using pdo_mssql driver.

We did not get any sample code in PHP which passes input parameter as JSON. I got below link but no luck.

Getting General error: 4004 General SQL Server error:

$stored_proc_stmt = "exec SP_NAME ? ";
$pdo_stmt = $this->_db->prepare($stored_proc_stmt);
$input = '{"productCode":"ABCD"}';
$pdo_stmt->bindParam(1, $input);
$stmt = $this->_db->prepare("SET ANSI_NULLS ON");
$stmt->execute();
$stmt = $this->_db->prepare("SET  ANSI_WARNINGS ON");
$stmt->execute();
$pdo_stmt->execute();
$results = $pdo_stmt->fetchAll();

Expected result should be in JSON. We don't want to make any change at the configuration level in the DB.

READ ALSO
Integrate NTLM Authentication on ubuntu18.04 apache2.4

Integrate NTLM Authentication on ubuntu18.04 apache2.4

what are the things needs to be done to integrate Apache2::AuthenNTLM in apache2 on ubuntu 1804 with php7

47
htaccess query string wildcard rewrite

htaccess query string wildcard rewrite

I've tried some suggestions from other posts on similar subject but were not able to solve this exact issue

22
Duplicate words in PHP [on hold]

Duplicate words in PHP [on hold]

I have probably information about whether it is available in PHP to detect a duplicate and a book about not removing it and adding it to -1, -2, -3

30
Find all child nodes of a parent in tree [on hold]

Find all child nodes of a parent in tree [on hold]

I have a tree in which i want all the left side child and right side child separately in table list but i couldn't get

47