Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Declaring cursor with where clause condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
Author Message
sasi.palani

New User


Joined: 01 Jun 2005
Posts: 14

PostPosted: Sat Jun 11, 2005 5:33 pm    Post subject: Declaring cursor with where clause condition
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
References
priya

Moderator


Joined: 24 Jul 2003
Posts: 624
Location: Bangalore

PostPosted: Sun Jun 12, 2005 12:57 pm    Post subject:
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

Active User


Joined: 09 May 2005
Posts: 51
Location: Singapore

PostPosted: Sun Jun 12, 2005 1:42 pm    Post subject:
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    Post subject: Re: Declaring cursor with where clause condition
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    Post subject: Re: Declaring cursor with where clause condition
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1