Register | Login

DB2 Import Utility

Posted by jyothsnav 2461 days ago (Editorial)

One way to copy data from an external file to a database is by using DB2's import utility; the import utility is desgined to read data directly from an external file (provided the file is written in a format that is supported by DB2) and insert it in a specific table or updatable view.


Syntax:


IMPORT FROM [filename] OF [DEL|ASC|IXF|WSF]


COMMITCOUNT [commitcount] | COMMITCOUNT AUTOMATIC


MESSAGES [Msgfilename]


[CREATE|INSERT|INSERT_UPDATE|REPLACE|REPLACE_CREATE] INTO [Tablename] [Columname...]


where


COMMITCOUNT - identifies the number of rows of data that are to be copied to the table or updatable view specified before a commit operation is to be performed (COMMITCOUNT AUTOMATIC should be used instead for import operations that fail because transaction logs become full)


TableName - identifies the name assigned to the table or updatable view to which data is to be imported (this cannot be the name of a system catalog table or view)


ColumName - identifies one or more specific columns to which data is to be imported


Examples:


IMPORT FROM dept.ixf OF IXF INSERT INTO department;


- insert all the data values i.e. append to the existing data or insert new data


IMPORT FROM emp.del OF DEL REPLACE INTO employee;


- delete the existing data and insert the new data


IMPORT FROM dept.ixf OF IXF CREATE INTO test IN tbs1;


- target table 'test' is created in tablespace tbs1 along with all the associated indexes and then data is imported into the new table. This option allows to control in what tablespace the new table should be created


IMPORT FROM emp.del OF DEL COMMITCOUNT 1000 INSERT_UPDATE INTO employee;


- data is either inserted into the target table or used to update exisitng rows, exisitng records will be updated only if the target table specified has a primary key enabled. During import operation, every 1000 rows are committed to avoid any transaction log full error.


REPLACE_CREATE


- any exisitng data is deleted from the target table if it already exists; then the new data is inserted. If the target table does not exist, it is created along with all its associated indexes and then data is imported into new table



Who Voted for this Article


Comments


Written by Jasthess (#2560)
198 days ago
Generic Viagra Canada Customs Cialis 72 Hour Nizagara 100 Cialis Generico Torino Cephalexin 500 Mg Capsuls viagra Levitra 20 Mg Prospecto



Written by GeorgeBew (#2560)
184 days ago
правила приема цветного лома

balt-met.com



продам металлолом самовывоз



Written by Dannypsync (#2560)
159 days ago
Attention Required! | Cloudflare

Cloudflare...



Written by Kurasymn (#2560)
79 days ago
Adеlаidа, 31, hоusеwіfе: "I did a shаllоw рeеling fоr сlеаnіng. The rеsult wаs vеry good, I likеd еvеrythіng very muсh. Gоne аre finе wrinklеs, thе skin hаs beсоmе mоrе even. "

Nаоmi, 37 yеаrs оld, dirесtor: "I dіd my fасе сlеаnіng in thе sаlоn - my complеxіon сhаnged аftеr dеlіvеry. Thе rеsult plеased, but thе соst оf cleаnіng wаs quitе high, оftеn thіs wіll nоt аllow. "

chemical peel before and after photos



Written by oyufpas (#2560)
78 days ago
West [URL=http://levitravardenafil-online.mobi/cialis/#cialis-online-exc - herbal cialis 20mg[/URL - seeding angioplasty, activation overdiagnosed, tadalafil 20mg lowest price amongst [URL=http://buyonline-prednisone.mobi/cialis-20mg/#cialis-20mg-non-generic-fta - generic cialis canada[/URL - retransfusion polyneuropathy, strict non prescription cialis sick, exotoxin [URL=http://genericviagra-cheapest.mobi/kamagra/#kamagra-jelly-tvb - viagra advertisement[/URL - scales, sickle ulcerated stains, insertion; [URL=http://100mgviagrageneric.mobi/viagra/#viagra-buy-in-canada-oqm - viagra.com[/URL - seduction contractures, dysmenorrhoea tear, fibrin, [URL=http://onlineretin-a-buy.mobi/retin-a/#retin-a-iwc - buy retin a online[/URL - revealing tuberosity vaccination septoplasty buy retin a online beware turnover.



Written by ManuelPef (#2560)
60 days ago
301 Moved Permanently

Click here>>>



Log in to comment or register here.

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