Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: cpelster on May 24, 2007, 04:23:35 am
-
Hi,
i wonder if there is any documentation on the SQLQuery query syntax, for example what SQL dialect to uses, how to escape characters and so on.
Since EA runs on many databeses i guess there is some kind of db abstraction behind this function?
regards,
christian
-
Anyone got any info on this?
I'd like it too.
-
I would treat it as though you are making a direct query to the database being used.
-
Already tried that - doesn't work.
I've added an extra table to the repository to store some additional info and tried a query such as:
IF OBJECT_ID (N'dbo.ut_Configurations', N'U') IS NOT NULL SELECT ConfiguredValue FROM ut_Configurations WHERE ParameterName='BaseDirectory'
which is valid syntax for SQL Server and runs correctly in SQL Management Console but not via SQLQuery which returns an empty string.
-
Personally, I would treat everything as Access.
From the EA Help for the parameter for SQLQuery: "SQL is a string containing an SQL Select Statement."
Your SQL has more than just a select statement. Does the select work on its own?
-
Yes the select by itself works fine. I just wanted to do a check for the existance of the table as not all repositories I connect to have it. I have worked around it by checking if it is a SQL repository (I know the EAP ones wont have it).
I needed to do this because SQLQuery displays a dialog box saying the table is not found if the table doesn't exist. I have my SQLQuery inside a try/catch but evidently SQLQuery doesn't throw an exception but rather displays the (unwanted) dialog. :(
-
I would suggest you log the no-exception as a bug or feature request.