Register | Login

DB2 Export Utility

Posted by jyothsnav 2461 days ago (Editorial)

The export utility is designated to extract data from a DB2 database table or view and externalize into a file using the file formats like DEL (Delimited ASCII), WSF (worksheet format), IXF (PC Information Exchange Format). Such files can then be used to provide data values to other databases and software applications such as spreadsheets and word processors.


Syntax:


EXPORT TO [filename] OF [DEL/WSF/IXF]


MESSAGES [Msgfilename]


[SELECT statement/XQuery expression]


where


filename - identifies the name and location of the external file data to which data is to be exported (copied)


Msgfilename - identifies the name and location of the external file to which messages produced by the Export utility are to be written as the export operation is performed


SELECT statement - Identifies a SELECT SQL statement that when executed will retrieve data


Example:


1. Suppose, you wanted to export data stored in a table named DEPARTMENT to a IXF format


EXPORT TO dept.ixf OF IXF


MESSAGES exp_msgs.txt


SELECT * FROM DEPARTMENT WITH UR;


2. If you wanted to export data in a table named EMPLOYEE to a delimited ASCII (DEL) fromat


EXPORT TO /data2/test1/employee.del OF DEL


SELECT * FROM EMPLOYEE WITH UR;



Who Voted for this Article



YourWiz.com, is a website that will allow everyone to share their knowledge, tip or information through community micro blogging.