title: Oracle sqlplus: relative paths starting at position of script
body: <p>When I have two sql-files, one of them in a sub-directory</p>
  
  <pre><code>main_test.sql
  sub/sub_test.sql
  </code></pre>
  
  <p>and <code>sub_test.sql</code>calls <code>@../main_test.sql</code> (or <code>@@../main_test.sql</code>) then this works fine when executing it from the sub-directory</p>
  
  <pre><code>sub&gt; sqlplus xxx @ sub_test.sql
  </code></pre>
  
  <p>But when I call</p>
  
  <pre><code>sub&gt; cd ..
  &gt; sqlplus xxx @ sub/sub_test.sql
  </code></pre>
  
  <p>this results in</p>
  
  <pre><code>SP2-0310: unable to open file "../main_test.sql"
  </code></pre>
  
  <p>since the path is evaluated from my working directory, not the directory of the sql-file I call.</p>
  
  <p>Is there a way to use relative paths starting from the directory of file containing the call?</p>