Ignore question marks (?) in comments in SQL (delphi)
Posted: 30.04.2018, 13:46
Hi all,
I hope these is a simple solution. Online searches was not able to assist me in solving this. Using Delphi XE5, Zeos 7.1.4 with PostgreSQL.
We are loading a library of scripts (compiled as resources) at runtime and executing the SQL.
Recently we started to encounter syntax errors and after some investigation I found these were caused by question marks in die SQL being interpreted as parameter placeholders. These question marks were added as part of comment strings in the SQL scripts.
In the past we encountered a similar issue, but were able to bypass it by setting ZQuery.Paramcheck := False;
Unfortunately, it seems as if this property is not checked where the '?' text is tested for. (I looked at code in procedure TZPostgreSQLCAPIPreparedStatement.Prepare in unit ZDbcPostgreSqlStatement.pas)
Is there any way to get what I want by setting other properties / parameters?
P.S I never use parameters in prepared statement - one can assume zquery.paramcheck will ALWAYS be false.
Regards
G Bouwer
I hope these is a simple solution. Online searches was not able to assist me in solving this. Using Delphi XE5, Zeos 7.1.4 with PostgreSQL.
We are loading a library of scripts (compiled as resources) at runtime and executing the SQL.
Recently we started to encounter syntax errors and after some investigation I found these were caused by question marks in die SQL being interpreted as parameter placeholders. These question marks were added as part of comment strings in the SQL scripts.
In the past we encountered a similar issue, but were able to bypass it by setting ZQuery.Paramcheck := False;
Unfortunately, it seems as if this property is not checked where the '?' text is tested for. (I looked at code in procedure TZPostgreSQLCAPIPreparedStatement.Prepare in unit ZDbcPostgreSqlStatement.pas)
Is there any way to get what I want by setting other properties / parameters?
P.S I never use parameters in prepared statement - one can assume zquery.paramcheck will ALWAYS be false.
Regards
G Bouwer