Quantcast
Channel: Oracle
Viewing all articles
Browse latest Browse all 1814

Forum Post: Inserting a text field that has the date and time from staging table to another table that the data type is timestamp.

$
0
0
Hi I am trying to create a sql script that inserts data from a staging table to the main table and in the staging table I have a column called datetime that is a varchar field. I am inserting all columns plus converting the datetime field to the field in the main table that has a datatype of time stamp. Data in im DateTime staging table looks like this. '10-JUN-16 12:00 AM' I tried this below and it didn't work. I got an error message saying. a non-numeric character was found where numeric was expected. My assumption is the AM is or the JUN is throwing it off. INSERT INTO meterdatarows SELECT 'HardCodedField', meterid, TO_TIMESTAMP (datetime, 'yyyy/mm/dd hh24:mi:ss'), value FROM meterdatarowsstaging commit; Thanks for the help.

Viewing all articles
Browse latest Browse all 1814

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>