Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sqlcl working directory set to where executable resides and not from where it is launched...bug?

espinJun 18 2015 — edited Jun 18 2015

sqlcl does not keep you in the directory where you launched it from.

Here is the problem I face:

I am in C:\a\b\c where I have a sql script, d.sql.

sqlcl executable is in c:\opt\sqlcl\bin (this is in my PATH)

d.sql is like the following:

set sqlformat csv;

set term off;

spool o.csv;

select table_name from tabs;

spool off;

quit

when I execute:

C:\a\b\c> sql usr/pwd@db @d

I get an error because d.sql is not found.

If I go through the interactive session it is because sqlcl sets the working directory to c:\opt\sqlcl\bin and yes there, there is no d.sql

So I launch it as follows:

C:\a\b\c> sql usr/pwd@db @c:\a\b\c\d

all works fine BUT for the fact that the spooled file is in c:\opt\sqlcl\bin


The fact of having to specify the full path for @<file> or for spool is like inconvenient, the default for no absolute path should be the directory from where you launched the application (and any explicit cd you explicitly perform in your script of course)

Please advise

Thank you a lot in advance

BR

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 16 2015
Added on Jun 18 2015
1 comment
1,305 views