Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts -502 Error - Cursor already open anand jeyapaul DB2 7 Sun Oct 29, 2017 4:22 am
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us