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

Insert date/time into Oracle table

I try to insert a date/time value into an Oracle table as following:

INSERT INTO table1 (ID, StartDate) VALUES (123, '01/27/2000 3:19:00 PM')

and I got an error:

ORA-01843: not a valid month

The definition of table1 is:

Field            DatatType

ID:             number
StartDate:       Date


Thanks for your help in advance.
0
advancefiber
Asked:
advancefiber
1 Solution
 
mshaikhCommented:
INSERT INTO table1 (ID, StartDate)
VALUES (123, to_date('01/27/2000 03:19:00 PM', 'MM/DD/YYYY HH:MI:SS PM' )
0
 
advancefiberAuthor Commented:
Thanks a lot.
0
 
msreekmCommented:
Help for Hierarchies
Helper tables handle dimensions with complex hierarchies.

We have created the following table to store the organization hierarchy:

unit_name
parent_id
node_id
begin_time
end_time
depthfromparent

desired output:
unit0
   unit1
       unit11
           unit 111
       unit12
   unit2

values in  table:
name  ,   nodeid,    parent , depth
---------------------------------------
unit0    , 1    ,     1,    0
unit1   , 2 ,        1,    1
unit11   ,  3,     1,  2
unit11,    3,     2,   1
unit111   ,  4,     1,  3
unit111,    4,    2,   2
unit111,    4,     2,   1

etc.....

We are unable to display the result in a hierarchical fashion . Intendation
of sub-units below the parent unit is not possible because there is no
linkage between them. Is it possible with the current structure or some
additional field like sequence no. is reqd.


Help and Reply will be highly appreciated.

Thanks,
Sreekumar Menon
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

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