The discard file simi-lar concept the bad file
,ch07.25656 Page 146 Wednesday, April 11, 2001 1:45 PM | Chapter 7: Validating and Selectively Loading Data | ||
---|---|---|---|
146 |
Field conditions are written as part of a WHEN clause. The WHEN clause is part of your INTO TABLE clause and is table-specific. If you are loading multiple tables, you can specify different WHEN clauses for each table.
The syntax for the WHEN clause is as follows:
position := POSITION({start[{: | -}end]) | |||
---|---|---|---|
|
condition
A WHEN clause can have any number of conditions ANDed together. Condi-tions may optionally be enclosed within parentheses.string
A character string.hex_digits
A string of hexadecimal digits.
This is the Title of the Book, eMatter Edition | ||
---|---|---|
Copyright © 2001 O’Reilly & Associates, Inc. All rights reserved. | ||
147 | |||
---|---|---|---|
|
The following LOAD statement provides an example of a WHEN clause. It loads feature names, but only for waterfalls located in Alger County:
|
||
---|---|---|
(
state CHAR TERMINATED BY ',' ENCLOSED BY '"',
feature_name CHAR TERMINATED BY ',' ENCLOSED BY '"',
feature_type CHAR TERMINATED BY ',' ENCLOSED BY '"',
county CHAR TERMINATED BY ',' ENCLOSED BY '"'
)It’s an unfortunate fact of life that you can only link field conditions together using the AND keyword. You can’t OR two conditions, nor can you use operators other than the ones used to test for equality and inequality.
This is the Title of the Book, eMatter Edition | ||
---|---|---|
Copyright © 2001 O’Reilly & Associates, Inc. All rights reserved. | ||