Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01849 for timestamp date conversion

citicbjDec 29 2008 — edited May 18 2010
I try to do these SQL select statements

1. SELECT cast (column_1 as timestamp )FROM my_table; --- column_1 is a column in my_table with data type as varchar2 and data looks like 25-OCT-2008
18:33:19

2. select to_timestamp (column_1, 'DD-MON-YYYY HH12:MI:SS') from my_table;

I got ORA-01849: hour must be between 1 and 12.

Then I run this sql : ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH12:MI:SS';

Then I execute above select statements again and got the same error message. Please advise where am I wrong. Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 15 2010
Added on Dec 29 2008
4 comments
19,841 views