MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Data Fetching From Table

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
Kris
Beginner


Joined: 27 May 2006
Posts: 14
Topics: 7

PostPosted: Fri Mar 14, 2008 9:12 am    Post subject: Data Fetching From Table Reply with quote

Hi,

I need help in fetching the data from the table.
My table looks like this.
Code:

USER      PRODUCT
----------------------
USER1    PRODUCTA
USER1    PRODUCTB
USER1    PRODUCTC
USER2    PRODUCTA
USER2    PRODUCTD
USER2    PRODUCTE
..

This table holds the users and products they can access.
Now my requirement is to produce a report of all the users & products they can access.
My report should be in the form of

Code:

USER1  PRODUCTA  PRODUCTB  PRODUCTC
USER2  PRODUCTA  PRODUCTD  PRODUCTE

I got around 30,000 users,each having more than 40 products.
Can i write any query to produce output in the above format
or advice me any tool i can use.

Thanks!!
Back to top
View user's profile Send private message AIM Address
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Mar 14, 2008 10:17 am    Post subject: Reply with quote

Kris,

What version of Db2 are you running? if you are DB2 V9 then look up the RANK function
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Kris
Beginner


Joined: 27 May 2006
Posts: 14
Topics: 7

PostPosted: Fri Mar 14, 2008 1:10 pm    Post subject: Reply with quote

Kolusu,
We are using DB2V8
Back to top
View user's profile Send private message AIM Address
vjkumk
Beginner


Joined: 28 Sep 2005
Posts: 98
Topics: 33

PostPosted: Wed Mar 26, 2008 10:28 pm    Post subject: Reply with quote

One way of getting the solution is,unload the table contents using a query to a flat file and use icetool and splice and use column one as key to get the format as you have mentioned.
Cheers,
vj
Back to top
View user's profile Send private message
edkir98
Beginner


Joined: 27 Aug 2007
Posts: 102
Topics: 42
Location: Chennai

PostPosted: Fri Mar 28, 2008 10:37 am    Post subject: Reply with quote

Hi Kolusu,
We are using DB2 V9. How is that possible using the RANK Function?
_________________
Thanks
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group