Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXPORT or UNLOAD Option in DB2-UDB

Status
Not open for further replies.

nanda369

Programmer
Jul 17, 2002
1
CA
Hi ,
I need to export a table content into a flat file. (In fixed file format)
The current EXPORT utility allows to export only in DEL Mode. Is there any other method available in UDB to achieve the same?
The datatypes of the columns available are CHAR,INTEGER,SMALLINT & DECIMAL
Pls advice. Currently we are planning to write a C Program to achieve the same.
regards,
Nanda
 
I move data from one UDB to another with this export:

connect to database;
EXPORT TO S:\Data\Movement\table.IXF OF IXF
MESSAGES S:\Data\Movement\table.IXF.MSG SELECT * FROM owner.table;

Use the IBM Control Center to help you with this.
 
Hi,


you could try on a command line when you're connected


db2 export to 'filenema.whatever' of del modified by coldel; select * from yourtable;

coldel gives you the field separator and you're free to choose whatever file extension you wish.

The ixf format conatins as well the table structure so you can migrate data.


export is just to dump data.

Cheers,
Pierre
 
Nanda,

I had the same problem as you and managed to overcome it as follows, using export.

EXPORT TO GREG.DEL OF DEL SELECT first_name CONCAT emp_no from .....

The output was then fixed format like below(although I'm not sure it will display correctly as a fixed file on the browser)

"David 10001"
"James 10002"
"Nanda 10003"

If the concat doesn't work out with you non CHAR fields perhaps you could "CAST" them on the select to another datatype. All in all this approach allowed me to get a flat fixed format file, albeit with " as the first character and the last character.

Cheers
Greg




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top