Home » SQL & PL/SQL » SQL & PL/SQL » time format
time format [message #228092] Sat, 31 March 2007 09:21 Go to next message
kris.c
Messages: 1
Registered: March 2007
Junior Member
I am trying to generate a software that used VB as the front end and Oracle 10G as the back end. I have noticed that the date format is VB is : m/dd/yyyy whereas the date format in oracle is dd-mm-yyyy. Whenever i try to insert a tuple with either of the date formats, the program halts running and after a long time , i get a message saying a deadlock was encountered. I have never had any formal introduction to either of the two tools, so, its quite possible that i am missing something quite trivial here.. any help appreciated.
Re: time format [message #228093 is a reply to message #228092] Sat, 31 March 2007 09:38 Go to previous messageGo to next message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

Hi,
deadlock was encountered


You should visit below link and post last few lines from ALERT<SID>LOG file.typically located>>. $ORACLE_HOME/<sid>/admin/bdump/alert<sid>.log

http://www.orafaq.com/faq/what_is_a_deadlock_and_how_does_one_fix_deadlock_errors


Regards
Taj
Re: time format [message #228327 is a reply to message #228092] Mon, 02 April 2007 09:54 Go to previous messageGo to next message
Ronald Beck
Messages: 121
Registered: February 2003
Senior Member
You should also review the various date formats you can use when you enter a date into Oracle. If you're going to send a date string (it's a character string, not a date number as Oracle understands it), you need to tell Oracle what format your string is in so Oracle can translate the string into a DATE type. For example...


insert into myTable (today_is) values (to_date('02-APR-2007', 'DD-MON-RRRR'));

insert into myTable (today_is) values (to_date('04/02/2007','MM/DD/RRRR'));

insert into myTable (today_is) values (to_date('04/02/2007 14:34:00','MM/DD/RRRR HH24:MI:SS'));



If this information doesn't make sense, go back and look up the to_date SQL function.

HTH,
Ron
Re: time format [message #228329 is a reply to message #228327] Mon, 02 April 2007 09:59 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
There is no need to use RRRR if you provide four digits. (I don't expect your application to fail over the Y10k bug.
So, in my opinion, the correct date-format would be 'DD-MON-YYYY' or 'DD-MM-YYYY' or whatever.
Re: time format [message #228335 is a reply to message #228329] Mon, 02 April 2007 10:30 Go to previous message
Ronald Beck
Messages: 121
Registered: February 2003
Senior Member
Either format will work for 4 digit years. I'm in the habit of using RRRR so that if I ever need the format 04/23/07, I'll enter MM/DD/RR rather than MM/DD/YY, which would enter 0007 as the year.

I agree that either will work with a 4 digit year. my discipline in coding dictates the use of RRRR as a more exact choice. Your mileage may vary. I've been burned too many times with a date of 06-JAN-0007 because of a bad input format.

Ron
Previous Topic: SQL Question
Next Topic: Connect by Without Prior
Goto Forum:
  


Current Time: Thu Dec 05 13:40:32 CST 2024