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
 
Select a Missing Rows

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
winchaat

New User


Joined: 23 Mar 2005
Posts: 14

PostPosted: Mon Jan 02, 2006 10:00 am    Post subject: Select a Missing Rows
Reply with quote

I have a requirement to select the rows from table which is not exist,
consider minimum value for eno is 01 & max 10, whithin this i need to select missing eno's.

anyone help pls!!!

ex-

eno dept
01 ABC
02 DEF
04 DEF
06 HJE
07 KLM
09 KLM
10 MSN


O/P Should be like this


eno

03
05
08


BY
RAG
Back to top
View user's profile Send private message

gowtham_1982
Warnings : 1

Active User


Joined: 02 Dec 2005
Posts: 109

PostPosted: Mon Jan 02, 2006 10:34 am    Post subject: Re: Select a Missing Rows
Reply with quote

winchaat wrote:
I have a requirement to select the rows from table which is not exist,
consider minimum value for eno is 01 & max 10, whithin this i need to select missing eno's.

anyone help pls!!!

ex-

eno dept
01 ABC
02 DEF
04 DEF
06 HJE
07 KLM
09 KLM
10 MSN


O/P Should be like this


eno

03
05
08


BY
RAG





hai rag,


we need to go for some logic as we are not sure the increment size of the field which is varying.

but for this i don't think we have any specific feature in SQL for accomplishing this.


please do let me know if you get to know...


kind regards,

gowtham
Back to top
View user's profile Send private message
rajesh_1183

Active User


Joined: 24 Nov 2005
Posts: 121
Location: Tadepalligudem

PostPosted: Mon Jan 02, 2006 11:24 am    Post subject: Re: Select a Missing Rows
Reply with quote

hi,

if ur eno follows the sequence...then use cursors...and a variable counter...compare the variable counter with each record fetched by the cursor...and write the missing records to a file..increment the variable counter for every read by the cursor..if ur table is not having duplicates..

icon_idea.gif Rajesh/Seshu icon_idea.gif
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 Conditional highlighting of rows in I... packerm CLIST & REXX 2 Thu Sep 21, 2017 6:50 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am

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