Skip to Main Content

SQL & PL/SQL

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!

sqlplus: using a spool file with relative path

425442Oct 6 2004 — edited Oct 6 2004
I have an issue which i am hoping has an easy answer ..

i am trying to generate the name of the sqlscript file inside another sqlscript file by using spool, and then executing the resultant script file, how can i do this with a relative path. i cannot do a CD to the location of the scripts.

wrapper sql file (a.sql)

spool tmp.sql
declare
..
begin
...

dbms_output.put_line('@@b_'||x||'.sql');
end;
@tmp.sql


Now the problem is i should be able to run a.sql from any directory so i will run like sqlplus user/pass@db c:\dir\a.sql but it will fail when
and when it tries to run @tmp.sql it will not find b_x.sql because the b_x.sql is not in the current directory, b_x.sql is also at c:\dir\b_x.sql

hope the issues is clear .. thanks








Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 3 2004
Added on Oct 6 2004
4 comments
951 views