Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SQLCODE=-518

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Mon Dec 08, 2008 7:56 pm    Post subject: SQLCODE=-518
Reply with quote

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
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Dec 08, 2008 10:38 pm    Post subject:
Reply with quote

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
View user's profile Send private message
mallik4u

New User


Joined: 17 Sep 2008
Posts: 75
Location: bangalore

PostPosted: Tue Dec 09, 2008 12:52 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Dec 09, 2008 1:04 pm    Post subject:
Reply with quote

Hello,

Yes, all of the sql that is part of the problem process should be posted.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQLCODE-000000080N priya91 DB2 1 Mon Feb 01, 2016 4:35 pm
No new posts Need to understand SQLCODE = 12 rohanthengal DB2 3 Thu Nov 05, 2015 11:22 am
No new posts SQLCODE -922 in Batch-Cics program tr... kishpra CICS 2 Thu Sep 10, 2015 12:36 pm
No new posts SQLCODE -450 for stored procedure spoorni DB2 3 Fri Jan 16, 2015 2:45 am
No new posts -81 SQLCODE returned when Remote Stor... kameswaramanoj.Akella DB2 1 Wed Dec 03, 2014 5:36 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us