Question: I'm trying to
do a sqlldr for a date column and I get the error "Missing right parenthesis"
with this:
PUBLISH_DATE
TIMESTAMP "to_date('12/24/2006 3:00:00 PM','MM/DD/YYYY HH:Mi:SS AM')"
I also tried this and got a "ORA-01821: date format not
recognized":
PUBLISH_DATE
DATE "to_date('12/24/2006 3:00:00 PM','MM/DD/YYYY HH:Mi:SS AM')"
How can I specify a default date like this in the sqlldr
control file without a syntax error?
Answer:
Whenever you invoke a SQL built-in
expression (to_date, to_char, etc.), you need the keyword 'expression' after
your column name to tell SQL*Loader that what follows should be executed as SQL
code.
PUBLISH_AMPM
EXPRESSION "TO_CHAR(SYSDATE,'AM')"