Print Thread
Suggestion: Let AutoSelect understand "@", and trim comments
#65836 08/16/24 01:18 PM
Joined: Nov 2023
Posts: 51
G
Member
OP Offline
Member
G
Joined: Nov 2023
Posts: 51
Say I have a SQL*Plus scripts that I want to run step by step in PL/SQL Developer's SQL window:
SQL Query
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.

Re: Suggestion: Let AutoSelect understand "@", and trim comments
guttormvik #65837 08/19/24 07:27 AM
Joined: Jun 2009
Posts: 15
Warsaw, Poland
S
Member
Offline
Member
S
Joined: Jun 2009
Posts: 15
Warsaw, Poland
Try running it in the Command Window instead - it imitates SQL*Plus so it would understand the @-statement.

Re: Suggestion: Let AutoSelect understand "@", and trim comments
Scovron #65838 08/20/24 10:27 AM
Joined: Nov 2023
Posts: 51
G
Member
OP Offline
Member
G
Joined: Nov 2023
Posts: 51
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.


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.028s Queries: 14 (0.006s) Memory: 2.5052 MB (Peak: 3.0397 MB) Data Comp: Off Server Time: 2024-10-14 12:16:08 UTC
Valid HTML 5 and Valid CSS