16.10.2015 Views

Getting Started with DB2 Express-C

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

162 <strong>Getting</strong> <strong>Started</strong> <strong>with</strong> <strong>DB2</strong> <strong>Express</strong>-C<br />

the database pages <strong>with</strong>out interacting <strong>with</strong> the <strong>DB2</strong> engine; however, this method does<br />

not make a check for constraints, and triggers are not fired. To guarantee consistency of<br />

the data loaded using LOAD, the SET INTEGRITY command is often used afterwards.<br />

The next sections describe the EXPORT, IMPORT, and LOAD utilities in more detail.<br />

Note:<br />

For more information about working <strong>with</strong> data movement utilities, watch this video:<br />

http://www.channeldb2.com/video/video/show?id=807741:Video:4262<br />

9.1 EXPORT utility<br />

The EXPORT utility is used to extract data from a table into a file as discussed earlier.<br />

Behind the scenes, an SQL SELECT operation is what is really being performed. The<br />

following example exports to the file employee.ixf of IXF format 10 rows from the table<br />

employee.<br />

EXPORT TO employee.ixf OF IXF<br />

SELECT * FROM employee<br />

FETCH FIRST 10 ROWS ONLY<br />

We encourage you to try the above example. The employee table is part of the SAMPLE<br />

database, so you first need to connect to this database created in a previous chapter.<br />

If you prefer to work <strong>with</strong> GUI tools, the EXPORT utility can also be invoked from the<br />

Control Center as shown in Figure 9.2.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!