Suggestion: Let AutoSelect understand "@", and trim comments

guttormvik

Member²
Say I have a SQL*Plus scripts that I want to run step by step in PL/SQL Developer's SQL window:

SQL:
insert into table ....;

@package/body/some_package.sql

/* some long comment
...
*/

insert into table ....;

First insert is fine.

I can't run the @-statement itself, which is slightly annoying, but I can live with that.
It would be amazing if it could run it though (with current directory set to either the current file's directory, or the predefined Files location I opened it from)

When I put the cursor in the second insert and run it, the AutoSelect will scan backwards and include both the comment and the @-statement, and give me an "ORA-00900 invalid statement" error.
Instead I have to select that statement before executing it.

It would be nice if the scanner understood that the "@" was a separate statement and stopped there.
It would be even nicer if it then scanned forwards, past the comment, and only selected the actual statement.
 
You can't load a file and selectively execute statements in Command Window. I would have to copy-paste.

In some cases it would be interesting to @-run the complete script in a Command Window, but there are at least two issues that makes this awkward:
* You have to go into config to change current directory, especially if the script contains other relative @commands
* It doesn't stop on error

On top of that it seems a bit slow? Due to the first two I have only used it a couple of times, so I don't have any hard numbers, but I want to say it takes twice as long as running in SQL*Plus.

If Command Window had a "Current Directory" input field and a "Stop on error" checkbox on top, I might've used it more, but I still think the SQL window is where I prefer to work.
 
Back
Top