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.

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

If you prefer to work from the Control Center, you can launch the IMPORT utility by<br />

selecting any table, right-clicking on it, and choosing the Import option as shown in Figure<br />

9.3<br />

Figure 9.3 – Launching the IMPORT dialog<br />

9.3 LOAD utility<br />

The LOAD utility is a faster way to load data from a file into a table. As discussed before,<br />

the LOAD utility does not go through the <strong>DB2</strong> engine, therefore triggers are not activated,<br />

the bufferpool is not used, and constraints can be enforced but only as a separate step.<br />

On the other hand, a LOAD operation is faster than IMPORT as it is a low level data loader<br />

directly accessing the data pages on disk. It works in three phases: LOAD, BUILD, and<br />

DELETE.<br />

The following example loads all the data from the IXF formatted file employee.ixf into<br />

the table employee_copy. The REPLACE option is one of the many options available <strong>with</strong><br />

LOAD. In this case it is used to REPLACE all of the contents of the employee_copy table.<br />

LOAD FROM employee.ixf OF IXF<br />

REPLACE INTO employee_copy<br />

After executing the above command, the table space where your table resides may have<br />

been placed in CHECK PENDING state. This means you need to run the SET INTEGRITY<br />

command to check the consistency of your data. The following example shows you how:<br />

SET INTEGRITY FOR employee_copy

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

Saved successfully!

Ooh no, something went wrong!