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
 

 

DB2 help

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

New User


Joined: 04 Dec 2006
Posts: 44
Location: Pune,India

PostPosted: Tue Jul 19, 2011 10:26 pm    Post subject: DB2 help
Reply with quote

Hi all,

A requirement is as below.

Around 60 tables are inter related by foreign key.I want to join all the tables and extract all the columns of the table to a report.

could you please suggest the ways of doing the same?
the simple way to doing this by writing sql will fail when delimiting the fields.

what all will be the other ways?

Thanks
Prasanth
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jul 19, 2011 10:49 pm    Post subject: Re: DB2 help
Reply with quote

prasanth_urs wrote:
tables and extract all the columns of the table to a report.

the simple way to doing this by writing sql will fail when delimiting the fields.


What kind of a report has delimited fields? Perhaps you mean file instead of report.
Back to top
View user's profile Send private message
prasanth_urs

New User


Joined: 04 Dec 2006
Posts: 44
Location: Pune,India

PostPosted: Tue Jul 19, 2011 11:07 pm    Post subject:
Reply with quote

yes, i require the file delimited by any special character and then export it to a spreadsheet.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 20, 2011 3:51 am    Post subject:
Reply with quote

Quote:
by writing sql will fail when delimiting the fields.


you mean by either an sql with select col1, ';',col2,';'....
or an unload with sql that has field/column separater.

i have shown you how to do it with select column, literal, ....
there are many examples in the forum for unloads,
as well as the manuals.
Back to top
View user's profile Send private message
prasanth_thavva

New User


Joined: 28 Jul 2005
Posts: 86
Location: Chennai

PostPosted: Wed Jul 20, 2011 12:17 pm    Post subject: Reply to: DB2 help
Reply with quote

Can you post ur SQL,what difficultly ur facing with that SQl while execution and also paste the error and relevant msgs.

To find foreign key refer the following SYSIBM.SYSREL to find out the relevant tables having the same column.

Refer this link --> http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2.doc.sqlref/zrels.htm
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:



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