Symptom
After successfully connecting to an Informix 11.7 database using the I10 driver, a sql statement in the dynamic
SQL format 2 is executed and returns the following error:
sql error -201: A syntax error has occurred
The embedded sql uses an argument and it appears that the argument value is not replacing the placeholder
('?') in the sql.
Environment
PowerBuilder, Informix
Reproducing the Issue
1. In PowerBuilder, use an existing application that connects to an I10 Informix database.
2. Use the following embedded sql script:
int wait_var = 5
PREPARE SQLSA
FROM "SET LOCK MODE to WAIT ?" ;
EXECUTE SQLSQ using :wait_var;
if sqlca.sqlcode <> 0 then
messagebox("SQL Error", sqlca.sqlerrtext)
end if
3. The script will return a sql error of: -201 - A syntax error has occurred
Cause
Engineering found that Informix is unable to accept bind variables (arguments with '?' place holder) in certain complex places.
Resolution
Use the dbparm of DisableBind=1. DisableBind is dynamic so you can set it to 1 for certain transactions and
then set it to 0 afterwards.