pro*c程式報SQL-02122

aluocp發表於2007-05-25
SQL-02122 Invalid OPEN or PREPARE for this database connection

Cause
An attempt was made to execute an OPEN or a PREPARE statement using a cursor that is currently open for another database connection and, therefore, cannot be used for this connection.

Action
Close the cursor to make it available for this connection or use a different cursor for this connection.



EXEC SQL at :db_name prepare COUNTHR_SEL from :H_sql;

如果上面這句話出錯,之後換個資料庫連線再執行上面這句話,就會報02122錯誤,是什麼問題?該如何解決?prepare沒有close一說吧?

第一次查詢如果出現table or view not exists這種錯

第二次查詢就會報 SQL-02122的錯

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7319461/viewspace-765259/,如需轉載,請註明出處,否則將追究法律責任。

相關文章