IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Continue to Execute next SQL Statements even after error


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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
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: 1448
Location: Chicago, IL

PostPosted: Thu Dec 21, 2006 6:02 am
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top