I'm trying to insert records with YYYY-MM-DD HH:MM:SS
format into Oracle from Netezza, but I'm getting invalid date type.
How can I accomplish this one?
CREATE TABLE AM_PROGRAM_TUNING_EVENT_TMP1
(
ST TIMESTAMP,
ET TIMESTAMP,
MAS_DIV_KEY INTEGER NOT NULL,
SBSC_GUID_KEY INTEGER NOT NULL,
STN_KEY INTEGER NOT NULL
);
INSERT INTO AM_PROGRAM_TUNING_EVENT_TMP1 VALUES('2012-03-28 11:10:00','2012-03-28 11:30:00',1,3636815,151);
Use TO_TIMESTAMP function
TO_TIMESTAMP(date_string,'YYYY-MM-DD HH24:MI:SS')
INSERT INTO AM_PROGRAM_TUNING_EVENT_TMP1
VALUES(TO_DATE('2012-03-28 11:10:00','yyyy/mm/dd hh24:mi:ss'));
http://www.sqlfiddle.com/#!4/22115/1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With