sqlplus: using a spool file with relative path
425442Oct 6 2004 — edited Oct 6 2004I 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