IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DB2 help


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Search our Forums:

Back to Top