Working directory when using "Execute with SQL*Plus"

Toad for Oracle Base Edition (64-bit) 25.2.376.6086

If I execute a script from Toad, e.g. myscript.sql, using Execute via SQL * Plus, relative paths aren't parsed correctly, because SQL Plus runs scripts relative to the current working directory of the SQL * Plus session, NOT relative to the location of myscripts.sql

Running this:
@@thisrunsok.sql
@@subpath/thisfails.sql

Results in "SP2-0310: unable to open file" in SQL*Plus

In Options | Executables, could you add a checkbox option to change directory to the file's working directory (if there is one), so that relative paths are resolved correctly?

Regards
Paul

I can reproduce and will log.

It looks like the issue occurs if you open a file from a different directory after loading myscript.sql. When I open myscript.sql and setup two referenced files per your example it works. However, if I open another file from a different directory than the one containing myscript.sql I see the error.

1 Like

This will be fixed in Monday's beta.

1 Like