Jump to content
Rod Stewart

DElphi XE 10 FireDac

Recommended Posts

Hello all,


I am converting a huge ZeosLib database application to FireDac under Delphi XE 10. All queries are executed by setting the SQL.Text property at runtime. On some queries I get exception messages like this:


[FireDAq[Phys][SQLite] ERROR: near';": syntax error


The fix for this problem is to remove semicolons from the end of SQL statements.
I am wondering if there is a property I can change and keep semicolons at the end of SQL statements to avoid mass changes?


Thank you.

 

Share this post


Link to post

FireDac is more strict especially with certain databases like SQLite, where the semicolon as the end of the statement can generate syntax errors.

 

Search/replace of the sql statements (with regex) is not an option for you? 

 

Alternatively you could create a descendant of TFDQuery and override ExecSql where you delete the semicolon at the end of sql.text. In this case you have to replace your TFDQuery objects with TFDMyQuery of course but you don't need to change the rest of the code. 

Share this post


Link to post

or write a function that checks if your text ends with a ';' character and if so deletes the ';' character. Then use a global search for each time you set the SQL property of the query and surround each text with a call to your new function.....

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×