• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1018
  • Last Modified:

"not a valid month"

I have an insert statement in Oracle

INSERT INTO TABLE1 (..., ...,...,CREATED_DATE, CREATED_BY..)
     VALUES(........L,'2012-01-27 11:42:04.830','JOHN','N')
Error report:
SQL Error: ORA-01843: not a valid month
01843. 00000 -  "not a valid month"
*Cause:    
*Action:


Date_type of
CREATED_DATE is      TIMESTAMP(6)            

How to fix this issue?
0
wasabi3689
Asked:
wasabi3689
  • 2
  • 2
1 Solution
 
slightwv (䄆 Netminder) Commented:
Never reply on implicit data type conversions.

Always to data conversions explicitly:

to_timestamp('2012-01-27 11:42:04.830','YYYY-MM-DD HH24:MI:SS.FF')
0
 
wasabi3689Author Commented:
I have this error by using

to_timestamp('2012-01-27 11:42:04.830','YYYY-MM-DD HH24:MI:SS.FF')

Error report:
SQL Error: ORA-00947: not enough values
00947. 00000 -  "not enough values"
*Cause:    
*Action:
0
 
slightwv (䄆 Netminder) Commented:
Post your complete statement.  You are missing a column or 10 between the insert and the select.

from: http://ora-00947.ora-code.com/
INSERT INTO EMP(EMPNO,ENAME) VALUES('JONES')



You can test just the to_timestamp with:
select to_timestamp('2012-01-27 11:42:04.830','YYYY-MM-DD HH24:MI:SS.FF')  from dual;
0
 
wasabi3689Author Commented:
never mind. I figure out
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now