View Single Post

   
  #1 (permalink)  
Old 04-08-2008, 10:04 AM
paulspratley@yahoo.co.uk
 
Posts: n/a
Default Inserting Milliseconds into table

Hi

How do use insert statements to insert millisecs into an oracle table?

CREATE TABLE [dbo].[script] (
[scriptid] numeric(20,0) NOT NULL,
[creationdate] datetime NOT NULL,
CONSTRAINT [PK_script] PRIMARY KEY([scriptid])
)
GO

I have tried:
INSERT INTO script(scriptid, creationdate)
VALUES(0, to_date('20060321 12:00:01.001','YYYYMMDD HH:mi:ss.ms'))

but get the error
>[Error] Script lines: 1-2 --------------------------

ORA-01821: date format not recognized 

and

INSERT INTO script(scriptid, creationdate)
VALUES(0, to_date('20060321 12:00:01.001','YYYYMMDD HH:mi:ss'))
but get the error
>[Error] Script lines: 1-2 --------------------------

ORA-01830: date format picture ends before converting entire input
string 

Thanks for the help!

Reply With Quote