Unhandled exception in Schema Modeler

(tobygroves) #1

Having a show-stopping problem here.

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.

Any suggestions?

SQL not validating backslash characters correctly
(antonk) #2


Could you send that .daSchema file to support@ ?

(tobygroves) #3


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 with Delphi 10.2 Tokyo by the way

(tobygroves) #4

Any luck? Do you see the same at your end?

(antonk) #5

Yes, I’ve answered to the message you sent to support@ . I’ve reproduces the issue and already working on it.

(tobygroves) #6

Ah ok thanks. I’ve worked round it for now by manually editing the DFM but obviously there’s a bug there somewhere.

(antonk) #7

Fixed the issue.

Here’s what caused it:

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

(tobygroves) #8

Ah ok thanks. Not sure why the MS SQL driver profile is expecting double-quote characters since SQL Server itself uses singles.

Can I get the code fix to implement here pending the next release?

(antonk) #9

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./

(RemObjects) #10

Thanks, logged as bugs://79670

(RemObjects) #11

bugs://79670 got closed with status fixed.

(tobygroves) #12

Ok thanks :slight_smile:

(tobygroves) #13

Was this fix ever included in a release? I can’t see any mention of it in the March release, did it not make it in time?

Can you provide the fix so I can implement it here as it’s causing problems again?

(antonk) #14

It is in the March release as

79670: Wrong kind of text quotes (single vs double) is used when probing SQL statement for parameter names

Which exactly issues do you have?

(tobygroves) #15

That isn’t showing on this page:


EDIT: I notice it’s there in the .NET version of DA - we’re using Delphi 10.2 As noted above. Has it not been fixed in this version?

(antonk) #16

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?

(tobygroves) #17

So to be clear, you’re saying the fix is included in the March release of Data Abstract for Delphi, despite it not being explicitly in the change log?

We’re not yet running this version but, if upgrading will fix this problem, we will try that.

(antonk) #18

It IS in the log, just in a different part of it. Btw this topic also contains a notification that the original issue has been fixed.

(tobygroves) #19

Ah ok I think I’m with you now, we’ll upgrade from the Nov release and that should sort it. Thanks.