Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Multiple statement sql
Wed, Aug 11 2010 9:15 AMPermanent Link

Kick

ENK Software

Hi Tim,

We are trying to convert a NexusDB project to ElevateDB. In this project there are lots of SQL statements that have multiple statements (separated by Wink So one EDBQuery component that contains multiple statements seperated with ;
This doesn't seem to work, saying that it expected end of statement....

I know I can do this with a script component but AFAIK that would mean I have to convert all statements to the form of:
EXECUTE IMMEDIATE ''<statement>"
That would mean a very large conversion project since the project is full of these kind of queries and my end users can also have made custom SQL statements and Reports containing SQL statements. And it's a difficult conversion to automate given the transformation from to string (Quotes have to be converted)

Are there any plans of implementing this multiple statement Query or can I accomplish this another way?
Wed, Aug 11 2010 10:42 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Kick


You basically have three choices:

1. Manually convert to script
2. Change the components to TEDBScript and use the ConvertSQL method (I never used it so can't comment any more)
3. Since all the old style script does is run each sql statement in sequence its easy to roll your own component, probably based on a stringlist to do the same.

Whilst I can't speak for Tim his responses in the past indicate he's not planning to reintroduce the DBISAM style scripts.

Roy Lambert [Team Elevate]
Wed, Aug 11 2010 2:08 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Kick,

<< I know I can do this with a script component but AFAIK that would mean I
have to convert all statements to the form of:
EXECUTE IMMEDIATE ''<statement>" >>

You can use this method to convert them in-place after putting them in a
TEDBScript component:

http://www.elevatesoft.com/manual?action=viewmethod&id=edb2&product=d&version=7&comp=TEDBScript&method=ConvertSQL

<< Are there any plans of implementing this multiple statement Query or can
I accomplish this another way? >>

No, it makes EDB susceptible to SQL injection attacks.

--
Tim Young
Elevate Software
www.elevatesoft.com
Thu, Aug 12 2010 4:28 AMPermanent Link

Kick

ENK Software

<<You can use this method to convert them in-place after putting them in a
TEDBScript component>>

I will try that, since we already have a wrapper around the query component in our framework, it would be easy to call convertsql before accually executing the script.

Otherwise option 3 Roy suggested would be a possible way to go.

Thanks!

PS: It would be really great though if the edbmanager would support multiple statements that way, even if it is only for administrators (sqlinjection is not really a threat when everthing is working behind the firewall is it?). It would make the use of scripts comming from other databaseplatforms a lot easier. Or can the ConvertSQL function be used in the edbmanager? couldn't find it....
Thu, Aug 12 2010 3:24 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Kick,

<< PS: It would be really great though if the edbmanager would support
multiple statements that way, even if it is only for administrators
(sqlinjection is not really a threat when everthing is working behind the
firewall is it?). It would make the use of scripts comming from other
databaseplatforms a lot easier. Or can the ConvertSQL function be used in
the edbmanager? couldn't find it.... >>

The 2.04 manager (not released yet) supports executing multiple statements
in a normal SQL statement window.  It allows you to select/deselect
statements for execution using the left gutter.  By default, however, it
uses ! as a statement terminator (File/Preferences/Editor) instead of the
semicolon, due to the fact that CREATE PROCEDURE/FUNCTION/JOB/TRIGGER type
of statements have embedded semicolons that confuse the select/deselect
parsing.

The ConvertSQL option is available from the Script menu when a script window
is active.  Just copy the entire set of SQL statements over the
SCRIPT..BEGIN..END block that is put there, and then select the Convert into
Script option.   The whole thing will get converted into an EDB script that
you can execute right away.

--
Tim Young
Elevate Software
www.elevatesoft.com
Wed, Aug 25 2010 3:14 PMPermanent Link

Kick

ENK Software

"Tim Young [Elevate Software]" wrote:

Sorry have been away for a while......

<The 2.04 manager (not released yet) supports executing multiple statements
in a normal SQL statement window.  It allows you to select/deselect
statements for execution using the left gutter.  By default, however, it
uses ! as a statement terminator (File/Preferences/Editor) instead of the
semicolon, due to the fact that CREATE PROCEDURE/FUNCTION/JOB/TRIGGER type
of statements have embedded semicolons that confuse the select/deselect
parsing.>

GREAT, that's just like I was used to in the NexusDB enterprise manager

<The ConvertSQL option is available from the Script menu when a script window
is active.  Just copy the entire set of SQL statements over the
SCRIPT..BEGIN..END block that is put there, and then select the Convert into
Script option.   The whole thing will get converted into an EDB script that
you can execute right away.>

Found it! Thanks a lot, for the great support. I also like the fact that you release "smaller" (although the new 204 seems te be packed with new features) new versions prety quick. This way we don't have to wait a long time for a big release with lots of new stuff before we get the new features we want. I like this much better than how the Nexus guys are treating new releases.
Is there a way of getting a notification of the new releases? or are they ending up in my spambox somewhere?
Thu, Aug 26 2010 7:02 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Kick,

<< Found it! Thanks a lot, for the great support. I also like the fact that
you release "smaller" (although the new 204 seems te be packed with new
features) new versions prety quick. This way we don't have to wait a long
time for a big release with lots of new stuff before we get the new features
we want. >>

We used to do the "big major release" also, but found out that it's just
easier for everyone to break things up into smaller chunks.

<< Is there a way of getting a notification of the new releases? or are they
ending up in my spambox somewhere? >>

You should automatically be getting notifications, unless they're getting
blocked, or you opted out of receiving such notifications.  You can check
this in your user profile on the web site here:

http://www.elevatesoft.com/user?action=view

under "Notifications".  You'll need to be logged in to the web site.

--
Tim Young
Elevate Software
www.elevatesoft.com
Image