oracle - Find non-numeric character instead of a numeric character -


i work oracle 11 g

and want update table

but have problem in format of date

the type of column timestamp , example of date in column : 11/12/05 16:08:00,000000000

this java code

string query = "update transfers set date_closed_transfer = '" +                 new date() + "', date_arch = '" +                 new date() + "', date_archhj = '" +                 datearchhj + "',action_type = '2',status_transfer = '" + status +                 "' id_transfer = '" + id + "'"; 

this query :

 update transfers      set date_closed_transfer = to_date('mon mar 24 10:39:25 gmt 2014','dd/mm/yy')',      date_arch = to_date("mon mar 24 10:39:25 gmt 2014","dd/mm/yy")',       date_archhj = '1435/5/23',     action_type = '2',     status_transfer = 'ap'     id_transfer = 'tr-70' 

but have error :

caused by: java.sql.sqlexception: ora-01858: caractère non numérique trouvé à la place d'un caractère numérique 

updated :

i try query :

update transfers set date_arch = to_timestamp_tz('tue mar 25 09:29:14 gmt 2014','dy mon dd hh24:mi:ss tzd yyyy'), date_archhj = '1435/5/24',action_type = '2',status_transfer = 'a' id_transfer = 'tr-78' 

but have error :

erreur sql : ora-01846: ce n'est pas un jour de semaine valide 01846. 00000 - "not valid day of week"

also try :

update transfers set date_closed_transfer = '25/03/2014', date_arch = '2014-03-25 09:59:47.123', date_archhj = '1435/5/24',action_type = '2',status_transfer = 'a' id_transfer = 'tr-61' 

but have error :

erreur sql : ora-01843: ce n'est pas un mois valide 01843. 00000 - "not valid month"

this valid example of date should e in column

31/03/02 00:00:00,000000000

the format mask provide in to_date function needs match string. plus, can use to_timestamp function, because column of timestamp datatype. therefore, should below:

updated query:

to_timestamp_tz('mon mar 24 10:39:25 gmt 2014','dy mon dd hh24:mi:ss tzr yyyy') 

references:

related question

the oracle to_date function


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -