changed to null because it was out of
SMALLINT
data type range (warning
SQL3117W
) and string
abcd
from the last row was truncated to
abc
because it was
longer than the relevant column definition (warning
SQL3125W
).
The
LOAD
utility generates messages in a similar format, but because it is
designed for speed, it bypasses the SQL engine, and inserts data directly into
table spaces without constraint checking. Inserting the same
table01.unl
file
(Figure 9 3) into
table01
(Figure 9 2) with the
LOAD
utility generates messages
without
SQL3148W, SQL0545N, SQL3185W
warnings as shown in Example 9 2.
Example 9 2 LOAD messages
db2> LOAD FROM table01.unl OF DEL REPLACE INTO table01
[..]
SQL3117W The field value in row "3" and column "1" cannot be converted to a
SMALLINT value. A null was loaded.
SQL3125W The character data in row "4" and column "2" was truncated because
the data is longer than the target database column.
[..]
Number of rows read = 4
Number of rows skipped = 0
Number of rows loaded = 4
Number of rows rejected = 0
Number of rows deleted = 0
Number of rows committed = 4
A table that has been created with constraints is left by the
LOAD
command in
check pending state. Accessing the table with SQL queries generates a warning
SQL0668N Operation not allowed for reason code "1" on table
"". SQLSTATE=57016.
The
SET INTEGRITY
SQL statement should be used to move loaded table into a
usable state. Example 9 3 shows a way to validate constraints. All rows that
violated constraints will be moved to exception table
table01_e
.
Example 9 3 Turning integrity checking on
db2> create table table01_e like table01
db2> set integrity for table01 immediate checked for exception in table01 use
table01_e
SQL3602W Check data processing found constraint violations and moved them to
exception tables. SQLSTATE=01603
272
MySQL to DB2 UDB Conversion Guide
footer
Our partners:
PHP: Hypertext Preprocessor Cheap Web Hosting
JSP Web Hosting
Ontario Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Java Hosting
Cheapest Hosting
Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved