Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update scipt question

Status
Not open for further replies.

eyetry

Programmer
Oct 2, 2002
560
US
The query below produces the following error...

where ins_date < to_date(20080327091000, 'yyyymmddhhmmss')
*
ERROR at line 6:
ORA-01810: format code appears twice


code:

update table_name
set UPD_PRGM = 'sqlplus',
UPD_DATE = SYSDATE,
UPD_USER = 'username',
process_date = to_date('03/27/2008', 'mm/dd/yyyy')
where ins_date < to_date(20080327091000, 'yyyymmddhhmmss')
and process_date is null


...I'm probably just a being thick but I don't understand the issue. Looks right to me. What's going on?
 
It should be

Code:
where ins_date < to_date(20080327091000, 'yyyymmddhhmiss')

You have used the code for month ('mm') twice instead of minutes ('mi'). This is a very common mistake.
 
Eyetry/KarlUK,

Your experience (and Karl's correct assessment) reminds me of one of my students that called me up and complained...
Student said:
Dave, Oracle is bogus...no matter what time it is, Oracle always displays the time to be "4 minutes after the hour"...and last month it always displayed "3 minutes" after the hour. What on earth is happening?
He called me up on April. <grin>

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top