How can you check if the SQL code entered by User is good and if not inform before running (or not runnig) the script?
I think try ... except ... end wil do the trick.
Yes, that was the question. But maybe TS can still use this method anyway. It gives an error if the SQL is incorrect and from the fail message you can pinpoint the exact error in the SQL.I think try ... except ... end wil do the trick.Not helpful: specific question was how to check validity of the SQL before attempting to run it.
... and if not inform before running (or not runnig) the script?
QuoteI think try ... except ... end wil do the trick..
/quote]
Not helpful: specific question was how to check validity of the SQL before attempting to run it.
There's no way to check the query before running it. Even other SQL editors runs or prepares the query and handles an exception if the query isn't right.
There's no way to check the query before running it. Even other SQL editors runs or prepares the query and handles an exception if the query isn't right.Of course there is: the fcl-db package contains a full SQL parser/scanner/syntaxtree that can validate the SQL without executing it. It can parse almost all Firebird SQL.
Without using try/except? Really?There's no way to check the query before running it. Even other SQL editors runs or prepares the query and handles an exception if the query isn't right.Of course there is: the fcl-db package contains a full SQL parser/scanner/syntaxtree that can validate the SQL without executing it. It can parse almost all Firebird SQL.
Thanks. Not very important. I am giving up this problem, the more that I do not understand your solutions. ;)Not really wise to give up, even if you are a beginner. How are you going to learn then?
im beginer....
I have another little problem. When loading different SQLITE files, each one has a FRAME_CONTENT column, but once it is column 3, in another file column 5.You probably mean
How to find a column with this content and return to the integer variable.
something like
x: = dbgrid.findcolumn ('Frame_content') ???