DD/MM/RR
the date should be entered as
01/01/00 or 01/01/2000
or
01/01/03 or 01/01/2003
In present code it is taking our input string as
20/00/0101
There is no month 00 so the error
tr entering 01012000 it will work
Main Topics
Browse All Topicstable.field STOCK.FECHA_EMISION_ORDEN is of type DATE (Ora 9.2, so it's in fact a DATETIME) and may be NULL
SELECT value FROM v$nls_parameters WHERE parameter = 'NLS_DATE_FORMAT'; returns DD/MM/RR
inserting into this field proves weird :
INSERT INTO STOCK (FECHA_EMISION_ORDEN ) VALUES ('') is ok
INSERT INTO STOCK (FECHA_EMISION_ORDEN ) VALUES ('20030101') is ok
INSERT INTO STOCK (FECHA_EMISION_ORDEN ) VALUES ('20000101') raises ORA-01861 the infamous format string error
needless to say, the original query :
INSERT INTO STOCK (FECHA_EMISION_ORDEN ) VALUES ('19700101') also fails miserably
Any ideas why Oracle seems to refuse dates before 2001 in a YYYYMMDD format ?!!?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
anad200v is correct, the problem arises from the NLS_DATE_FORMAT DD/MM/RR.
However, you should always explicity convert a date string and not rely on Oracle. None of the statements will fail if they are written:
INSERT INTO STOCK (FECHA_EMISION_ORDEN ) VALUES (TO_DATE('','YYYYMMDD') );
INSERT INTO STOCK (FECHA_EMISION_ORDEN ) VALUES (TO_DATE('20030101','YYYYM
INSERT INTO STOCK (FECHA_EMISION_ORDEN ) VALUES (TO_DATE('20000101','YYYYM
INSERT INTO STOCK (FECHA_EMISION_ORDEN ) VALUES (TO_DATE('19700101','YYYYM
VGR:
take it easy....
when you insert into the table with the value '20030325', you can successfuly execute it but that does not mean you have entered the correct value..
Here is the output of your select query:
INSERT INTO STOCK (FECHA_EMISION_ORDEN ) VALUES ('20030325');
1 row inserted.
select FECHA_EMISION_ORDEN from stock;
FECHA_EMISION_ORDEN
20/03/25 -------->look what happened here??? it's wrong value .
So anand_2000v is correct on this..
of course that Oracle is better than SQL-Server... How could it be the reverse ? :D :D
Now, as I come from a real , modern, powerful & fast RDBMS, I have problems understanding Oracle's limitations in some areas, inclusing DATE & TIME and the internal non-standard DATETIME format, STRING manipulation, etc
I worked in Oracle 5 and 6 during my youth, but I hadn't noticed those oddities :D
As for my above problem, I think you all gave me what you could ("la plus belle fille du monde ne peut donner que ce qu'elle a") and I will come back later after having checked if, yes or no, the original "bad" method worked or not
The default format is what you make it. Each and every terriotory has a different format. The final storage is obviously SQL-Compliant. Just set a parameter NLS_DATE_FORMAT in the init file and see it behave the way you want. Oracle is a very pliable software. It will behave the way you want it. Just ask us whenever you have a doubt and your transfer to Oracle will be very smooth. Enjoy your time with Oracle.
RollRoyce and Boeing fell out over date representation..
on 11th October RollsRoyce got a phone call saying they were in default of contract and when were they going to pay the penalties!
They thought the contract was deliverable on 10th of November !
Thereafter companywide all dates had to be represented in the following format !
to_date(' 01-APR-2000 23:59:59', 'DD-MON-YYYY HH24:MI:SS' )
not every business culture understands what your default format is.
Business Accounts
Answer for Membership
by: VGRPosted on 2003-09-22 at 01:35:41ID: 9404184
for the censors behind : it's an URGENT question :D