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

Declaring cursor with where clause condition


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sasi.palani

New User


Joined: 01 Jun 2005
Posts: 14

PostPosted: Sat Jun 11, 2005 5:33 pm
Reply with quote

If I am declaring cursor with where clause condition, if condition not met, what will happen?
Back to top
View user's profile Send private message
priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Sun Jun 12, 2005 12:57 pm
Reply with quote

If condition not met. you will get an error....

UNDECLARED CURSOR (Only if you try to open the cursor in your pgm)
Back to top
View user's profile Send private message
kvivek

New User


Joined: 09 May 2005
Posts: 51
Location: Singapore

PostPosted: Sun Jun 12, 2005 1:42 pm
Reply with quote

You will get sqlcode +100 when you try to fetch the cursor for the first time itself.

Regards,
Vivek
Back to top
View user's profile Send private message
j_prameela2000

New User


Joined: 01 Jun 2005
Posts: 28
Location: Chennai

PostPosted: Wed Jun 15, 2005 11:41 am
Reply with quote

Hi Sasi,

When the condition is not met, cursor will not be created. No records will be fetched. Once when you open the cursor using open command itself will raise an error. Correct me if i am wrong.
Back to top
View user's profile Send private message
subbprem

New User


Joined: 20 Apr 2005
Posts: 9
Location: Chennai

PostPosted: Thu Jun 16, 2005 12:52 pm
Reply with quote

Hi,

When the cursor is declared properly and if the condition is not met then you will get sqlcode +100 in first fetch itself, which means no to row to fetch.There will be no problem in opening the cursor.

If there is any error in cursor declaration then we will end-up with pre compilation error.

Correct me if anything is wrong.

Regards,
Prema.
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Filter records where condition is in ... SYNCSORT 6
No new posts Extract records for a specific condit... DFSORT/ICETOOL 25
No new posts Write record twice based on condition... SYNCSORT 7
No new posts Setting RC using NULLOFL/NOTMTOFL for... SYNCSORT 6
No new posts Add condition to a FINDREP SORT card DFSORT/ICETOOL 4
Search our Forums:


Back to Top