View previous topic :: View next topic
|
Author |
Message |
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
I got an SQLCODE=-518 when I execute a dynamic SQL:
Code: |
-518 THE EXECUTE STATEMENT DOES NOT IDENTIFY A VALID PREPARED STATEMENT |
I have written a dynamic SQL which fetches a cursor.
after fteching the cursor immediately I am calling a sub proc which inserts into a table.
If I comment the call statement which calls insert query the cursor is
fetching all the rows. if I uncomment it it is throwing SQLCODE=-518.
I am bypassing the duplicate rows for the insert query by assiging sqlstate=00000.
Can any one suggest me the solution . |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You need to post all of the sql.
Quote: |
I am bypassing the duplicate rows for the insert query by assiging sqlstate=00000. |
Please clarify what this is telling us. |
|
Back to top |
|
|
mallik4u
New User
Joined: 17 Sep 2008 Posts: 75 Location: bangalore
|
|
|
|
Hi,
It would be better if you post the CURSOR declaration statement along with PREPARE statement of the SQL.
One possible problem, 'WITH HOLD' option might be missing in CURSOR declaration. This might be the problem only when your called program is also updating the same table what CURSOR is referring.
Thanks & Regards,
Mallik |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Yes, all of the sql that is part of the problem process should be posted. |
|
Back to top |
|
|
|