Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 648
  • Last Modified:

I get a syntax error trying to call an informix stored procedure.

I keep getting this error Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft OLE DB Provider for ODBC Drivers<br/><b>Description:</b> [OpenLink][ODBC][Informix Server]A syntax error has occurred. (-201)' in  com->Open('execute procedu...', Object(com))
I am calling the stored procedure, like this
$sqlStr='execute procedure supapp_view_orders("value","value")';
$adoConn = new COM("ADODB.Connection") or die("Can't start ADO");
 $recordSet = new COM("ADODB.RecordSet") or die("Can't create record set");
$adoConn->Open("DSN=value;Database=value;UID=value;PWD=value");
$recordSet->Open($sqlStr, $adoConn);
The connection itself works and I can run a normal query though just fine.
Am I calling the stored procedure incorrectly, or would this be an underlying syntax error in the stored procedure?
0
haloexpertsexchange
Asked:
haloexpertsexchange
1 Solution
 
haloexpertsexchangeAuthor Commented:
Never mind it, I figured out the syntax error, $sqlStr="execute procedure supapp_view_orders('value','value')"; Just swap around the single, double quotes and its fine.
Now I just have to see if I can get a stored procedure to run on a read-only connection.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now