I have the following Timestamp With Time Zone column value in Postgresql:
2011-09-13 07:38:01+00
Which I convert to the necessary Date format expected by Oracle in the select:
select to_date(date_column, 'DD.MM.YYYY HH24.MM.SS') as date_column from table;
Which matches the Date format expected by Oracle or NLS mask. Upon inserting the row into Oracle through the ETL process however, this error is thrown:
ORA-01830: date format picture ends before converting entire input string
Any ideas what may fix the conversion correctly?
2
Answers
If I assume
date_column
is holding a value2011-09-13 07:38:01+00
and thus its datatype would beVARCHAR2
. In such case, you can first get zone+00
trimmed usingSUBSTR
, and then applying ‘to_date’ with a compatible format should give a date.select to_date(SUBSTR(date_column, 1, 19), 'YYYY-MM-DD HH24:MM:SS') as date_column from table;
In this query
You have "MM" for MONTH and MINUTES both, try switching to acceptable format. As per my knowledge "MI" is used for minutes. This might help.