LOAD DATA
INFILE 'Sample2.dat'
APPEND INTO TABLE EMP_LEAVE
WHEN REQUEST_DATE > SYSDATE --The problem lies here
FIELDS TERMINATED BY ","
(REQUEST_NO,
EMPNO,
REQUEST_DATE DATE "DD-MM-YYYY",
START_DATE DATE "DD-MM-YYYY",
END_DATE DATE "DD-MM-YYYY",
REASON,
LEAVE_TYPE,
NO_OF_DAYS,
APPROVAL
)
I'm trying to insert only those rows where the REQUEST_DATE is higher than the current date. Any idea how I could do that?
As far as I can tell, you can't directly from SQL*Loader.
WHENclause, which is used to conditionally load records, accepts only "equal" or "not equal" operators, i.e.=,<>or!=, i.e. you can't use "greater than">and similar.For more info, see this:
So, what to do?
WHEREclause you want, includingwhere request_date > sysdate)