Parse SQL with UniDAC
Posted: Thu 05 Sep 2019 21:03
Hi,
I have to parse SQL statements (MySql or PostgreSql) for params:
Input: "select * from PERSON where NAME = :PNAME and CITY = :PCITY"
Output: "select * from PERSON where NAME = ? and CITY = ?" and array ("PNAME", "PCITY")
I found the code in TCRCommand.ParseSQL for this. But how to use it without any connection? Can I just create a TCRCommand object and call ParseSQL?
Or what is the correct way to use this code?
Christian
I have to parse SQL statements (MySql or PostgreSql) for params:
Input: "select * from PERSON where NAME = :PNAME and CITY = :PCITY"
Output: "select * from PERSON where NAME = ? and CITY = ?" and array ("PNAME", "PCITY")
I found the code in TCRCommand.ParseSQL for this. But how to use it without any connection? Can I just create a TCRCommand object and call ParseSQL?
Or what is the correct way to use this code?
Christian