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
 

 

Continue to Execute next SQL Statements even after error

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

New User


Joined: 15 Aug 2006
Posts: 44
Location: Virginia, USA

PostPosted: Tue Dec 19, 2006 8:46 pm    Post subject: Continue to Execute next SQL Statements even after error
Reply with quote

I need to execute around 400 SQL statements in spufi or thru jcl. when executing if any 1 error occurs it stops executing in Spufi. If i u DSNSTEP in JCL it allows only 11 errors and stops executing.

My question is, Is there anyway to execute all the sql statements even if error out some sql statements.

For example
Select col1 from ta table;
Select col2 from tb table;
...

I really appriciate if somebody can provide me with solution

Thanks
Suresh
Back to top
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Dec 19, 2006 11:09 pm    Post subject: Re: Continue to Execute next SQL Statements even after error
Reply with quote

What kind of errors are you experiencing?

Dave
Back to top
View user's profile Send private message
alluri12

New User


Joined: 15 Aug 2006
Posts: 44
Location: Virginia, USA

PostPosted: Wed Dec 20, 2006 2:21 am    Post subject:
Reply with quote

SQLCODE = -204 Table not found
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Dec 21, 2006 5:44 am    Post subject: Re: Continue to Execute next SQL Statements even after error
Reply with quote

I guess I have a question as to why you are running queries against tables that do not exists. What is your objective in doing this ?
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Thu Dec 21, 2006 6:02 am    Post subject: Re: Continue to Execute next SQL Statements even after error
Reply with quote

Quote:
Is there anyway to execute all the sql statements even if error out some sql statements.

Apart from what Mr. David asked, why would you not like to abend, in case such error occurs... Anyway, code them all in a COBOL-DB2 program, and keep execution even if you get SQL Code other than ZERO until last Query.
Back to top
View user's profile Send private message
alluri12

New User


Joined: 15 Aug 2006
Posts: 44
Location: Virginia, USA

PostPosted: Thu Dec 21, 2006 7:09 pm    Post subject:
Reply with quote

I know some of the tables does not exist. But I don't know which one of them in my envirment. I am expecing that -204 sqlerror code. The only thing i want to know is there a way to bypass all the errors and execute next sql statement in DB2.
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Thu Dec 21, 2006 10:27 pm    Post subject: Hello
Reply with quote

If u wnat to run u r queries even if u r table do not exist just code

if any other error code apart from 0 just continue...

However u r results will not be as exepected ...
What I dont understand is is why are running queries aganist tables that do not exist...
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 Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts INVOKE WEBSERVICE error danik56 CICS 11 Thu Mar 09, 2017 11:52 am


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