Home » DbVisualizer Forums » DbVisualizer » DbVisualizer - Feature Requests

Thread: New Inline editor commands


Permlink Replies: 2 - Pages: 1 - Last Post: Mar 12, 2007 10:04 AM Last Post By: mark lawford
mark lawford

Posts: 77
Registered: 08/23/05
New Inline editor commands
Posted: Mar 7, 2007 4:00 PM
   thread.click_reply Reply

We know we can change things like statement deimiters through the preferences dialog but on some occasions it would be useful to have a command that essentially says "in this block, use the following preferences".

What's prompted this is that I'm just working up a unit test script for the addition of a DB2 trigger. The trigger needs to run 2 sql statements in response to an update. As it needs to run 2 statements the drop and create statements have to look like the example below (where @ is the new delimiter).

DROP TRIGGER MYSCHEMA.MYTRIGGER@
CREATE TRIGGER MYSCHEMA.MYTRIGGER
AFTER UPDATE OF SOME_FIELD ON MYSCHEMA.MYTABLE
REFERENCING NEW ROW AS NEW
FOR EACH ROW
MODE DB2SQL
WHEN (new.SOME_FIELD = 'D')
BEGIN ATOMIC

the first sql statement goes here;

the second sql statement goes here;

END
@


Ideally, my unit test script will have a bunch of statements to set up test data, run in the trigger and then a bunch of statements to trigger it and verify the results.

I don't want to write the whole script using the @ statement delimiter as it isn't highlighted as with semi-colon and would be non-standard and liable to confuse.

If I could surround a statement with a command that says "use this delimiter", I could drop in those non-standard sql statements and then return to the rest of the script using our standard expected delimiters.

I'm sure there are other settings that would be useful to set within a script through the use of commands but this is the one that's making me revisit the properties panel a lot today.

Roger Bjarevall


Posts: 3,180
Registered: 12/17/04
Re: New Inline editor commands
Posted: Mar 12, 2007 9:24 AM    global.in_response_to.tooltip in response to: mark lawford
   thread.click_reply Reply
Mark,

Something like:

\
SQL1 here;
@set delimiter "@";
SQL2 here...@
SQL3 here...@
@set delimiter default;
SQL4 here;
Regards

Roger
mark lawford

Posts: 77
Registered: 08/23/05
Re: New Inline editor commands
Posted: Mar 12, 2007 10:04 AM    global.in_response_to.tooltip in response to: Roger Bjarevall
   thread.click_reply Reply

Yes, that kind of thing would be ideal.

I'm sure there are other "preferences" that users would like to see made available the same way. As I come across settings I'd use I'll post back here.


Point your RSS reader here for a feed of the latest messages in all forums