If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > cause of SQL0519N error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-26-03, 05:29
telenko telenko is offline
Registered User
 
Join Date: Nov 2003
Posts: 6
cause of SQL0519N error

I have a java stored procedure where I often run into the following error: SQL0519N The PREPARE statement identifies the SELECT or VALUES statement of the open cursor "SQLCUR381"
when I execute certain statements.

I have been able to solve the problem in certain cases by using "trial and error" tactics, but in some cases I can not determine the cause of the error. I am absolutely sure that all resultsets of the statements I use are closed before I execute the statement again (I must have checked it about 20 times by now).
I will not post any code. I have done that a week ago, but did not get any answers on my question. The code is way to long and complex and it would take too much time to dive into it.

I can hardly believe that I am the only one running into this problem. So
what I am looking for is a theoritical answer to my questions:
*) what can be the cause of this SQL0519N error?
*) what limitations do I have to take into account when working with java stored procedures?
*) can I use nested statements on the same table, that is can I loop through a resultset on table X and perform another query on table X from within that loop?

Any help would be greatly appreciated.

Luc Feys
Reply With Quote
  #2 (permalink)  
Old 11-27-03, 09:03
telenko telenko is offline
Registered User
 
Join Date: Nov 2003
Posts: 6
I'm finally out of it. I was using two objects (O1 and O2), each retrieving its own connection object through the DriverManager (with url "jdbc:default:connection").
Since all calls to O2 were coming from O1, I passed the connection of O1 to O2 instead of having O2 create its own connection. And gone were all the mysterious errors.

Woohoo.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On