Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>OK so I was able to get this working, of sorts.</p> <p>It turns out that when creating the database link, the double quotes around the username and password fields were causing the issue. To summarise:</p> <p>If they were present, and the link created as so:</p> <pre><code>create database link remote_link connect to "remote_user" identified by "remote_pass" using 'REMOTE_DB'; </code></pre> <ol> <li>The remote database <strong>could</strong> be queried via sql</li> <li>The stored procedure <strong>could not</strong> be compiled, recieving the ORA-942 error</li> <li>As the procedure could not be compiled, it could not be executed</li> </ol> <p>When the double quotes are not present:</p> <pre><code>create database link remote_link connect to remote_user identified by remote_pass using 'REMOTE_DB'; </code></pre> <ol> <li>The remote database <strong>could not</strong> be queried via sql, recieving an invalid password error (detailed in the question)</li> <li>The stored procedure <strong>could</strong> be compiled with no errors.</li> <li>The stored procedure <strong>executes as expected</strong>, retrieving data from across the database link, and displaying it.</li> </ol> <p>So, even though the remote database cannot be querued via sql, recieving an invalid password error, the procedure that uses this same connection information compiles and executes normally.</p> <p>I'm sure you'll agree, this is a curious state of events, and I genuinely stumbled across making it work in my scenario. I'm not quite sure I would call it a solution, as there are plenty of unanswered questions.</p> <p>Hopefully if someone comes here via google, they'll find this answer useful, and at least get their code running.</p> <p>GC.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload