I’m trying to modify a large script I have stored within a command inside a TDASchema. This script is over 5000 lines long. Note that it’s not actually a command, I just use this as a storage area for the script which I then use elsewhere.
Any attempt to modify this script is resulting in a window popping up saying “unhandled exception” but with no text in the window. The schema modeler then closes.
This has only started happening since I upgraded to the latest components and is now stopping me working as I need to modify this script.
I’ve stripped everything else out of it apart from a single command containing the large script. Just edit this script in any way at all and then attempt to save the changes (just moving focus does it) and it’ll crash every time for me without fail.
I’m on 9.3.105.1351 with Delphi 10.2 Tokyo by the way
You used ' instead of " to define string constants in the statement (MS SQL driver profile you used expects " quotes). This caused the statement validator to enter into string constants looking for parameter names instead of skipping them. One of the constants contained text like Foo : Bar which actually crashed the parser (it was considered as definition of a statement parameter w/o a name). This crash is fixed now
Actually MS SQL supports both doubles and singles. Yet since the single quotes are SQL-92 standard I guess I’ll need to add support for both kinds of quotes.
Unfortunately code fix won’t help you because you’d need to recompile the Schema Modeler to get it working. The only option is to wait for the next Beta drop.
There is a workaround - copy your script to a plain text editor, replace all ' with " and paste the script back. The resulting SQL script will be valid for MS SQL and won’t crash the Schema Modeler.
I’m logging an issue to add support for single quotes so you’ll see when it will be done./
The fix required has been made in the code Data Abstract for .NET package. Schema Modeler by itself relies on Data Abstract to perform some operations (including this one that failed).
So if you have an issue now this is most probably something different. Could you provide a tastcase and steps o reproduce the issue?