I have to validate 2 columns while loading my data.
I tried using this logic.
Need to load RECORD_TYPE in (1, 3).
Send me the syntax for the same.
I tried something like this...
LOAD DATA
APPEND
INTO TABLE IPDR_3G_REL2_TMP
WHEN VENDOR != 'TRA' AND VENDOR != 'HEA'
AND (RECORD_TYPE = '1' OR RECORD_TYPE = '3')
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
I tried something like this...
LOAD DATA
APPEND
INTO TABLE IPDR_3G_REL2_TMP
WHEN VENDOR != 'TRA' AND VENDOR != 'HEA'
AND (RECORD_TYPE = '1' OR RECORD_TYPE = '3')
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
I am getting syntax error.
The problem is OR operator between the two field conditions in the WHEN clause.
Unfortunately SQL*Loader support only AND operator between different expressions in the WHEN clause.
Maybe it will be easier for you to create a simple check constraint on the table before starting your load.
Jurij Modic ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
And what is stopping you from creating a simple CHECK constraint on that table, where you can easily check that only RECORD TYPE IN ('1', '3') are allowed?
That way, your loader session will try to load records with any record_type, but all that violate that check criteria will be rejected by the constraint. So instead of letting SQL*Loader to do the checking you let the database to do it instead...
Jurij Modic ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
Bookmarks