in reply to Oracle Db Link Error ORA-01001: invalid cursor

If it is the prepare statement failing, it seems likely the problem is with your SQL. You don't show us that so it's hard to tell. Also, are you sure your database connection is being created successfully?

But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)

  • Comment on Re: Oracle Db Link Error ORA-01001: invalid cursor

Replies are listed 'Best First'.
Re^2: Oracle Db Link Error ORA-01001: invalid cursor
by mediocremorsov (Initiate) on Jan 10, 2017 at 13:24 UTC
    The innermost select query is in a loop that queries across multiple databases. And the query works for some databases and for some the prepare statement throws an error. The tablename is the same across databases For e.g
    select * from customers@db_01; <-- This will execute ... ... select * from customers@db_08; <-- This one will throw a prepare fail.
    I am currently investigating if the way I open my local DB connection with AutoCommit has got anything to do with this.

      What is the relationship between id and linkname, is it 1 to 1, 1 to many or many to 1 ?

        it is 1 to many. 1 id to many dblinknames