This is a discussion on Inserting Milliseconds into table within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hi How do use insert statements to insert millisecs into an oracle table? CREATE TABLE [dbo].[script] ( [scriptid] numeric(20,0) ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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! |
| ||||
| >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 Doesn't seem like Oracle syntax to me. It's MS SQL Server or am I drinking too much coffee lately? Anyway, you need to use TIMESTAMP datatype if you want milliseconds (available in 9i and later.) And format specifier for milliseconds is FF[precision], so correct format string would be TO_TIMESTAMP('....','YYYYMMDD HH24:MI:SS.FF3') Hth, Vladimir M. Zakharychev N-Networks, makers of Dynamic PSP(tm) http://www.dynamicpsp.com |
| Thread Tools | |
| Display Modes | |
|
|