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
 

 

Declaring cursor with where clause condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    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

priya

Moderator


Joined: 24 Jul 2003
Posts: 568
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

New 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
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 Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts Joinkeys with condition scdinesh DFSORT/ICETOOL 10 Tue Feb 14, 2017 12:20 am
No new posts Release of Adabas Cursor mohitsethi All Other Mainframe Topics 1 Mon Feb 06, 2017 8:36 pm


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