SQR: How to handle Dynamic SQL in Where Clause when values could contain a single quote?
Hi SQR Programmers!
I am trying to include some Dynamic SQL in my Select statement so I don't have to write the same SQL 3 different times. One of my conditions is to check this table for the employee's city. A few of the cities contain a single quote. This is causing an issue when the SQR runs.
Example Dynamic condition:
!* Check City
let $Dyn_Cond = 'and a.city = '''|| $city || ''''
I get this error:
SQR 5528) ORACLE OCIStmtPrepare error 1756 in cursor 13:
ORA-01756: quoted string not properly terminated
The city it came across is this.
:1) AND ft.eff_status = 'A' AND ft.state = :2 and ft.city =