Home » Developer & Programmer » Forms » TO_CHAR problem ORA-01855
TO_CHAR problem ORA-01855 [message #180210] Fri, 30 June 2006 14:10 Go to next message
wael890610
Messages: 17
Registered: June 2005
Location: Egypt-Ismaelia
Junior Member

when i excecute this statement
select to_date(' 10:00 AM','hh:mi am')+2.5*(60*60)/86400
from dual;
i have error ORA-01855
(my NLS_LANG =AMERICAN_AMERICA.WE8ISO8859P1)
thnx Smile
Re: TO_CHAR problem ORA-01855 [message #180211 is a reply to message #180210] Fri, 30 June 2006 14:48 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Why is this a Forms question?
It worked for me, but what is the purpose of this query? All you are doing is adding 2.5 hours to some time, yet you are only showing a DATE in the output. You should be using a format mask to show the time. It can also be simplified to a much shorter and easy to read calculation.
tstdb UID> show parameter nls

NAME                                 TYPE    VALUE
------------------------------------ ------- ------------------------------
nls_language                         string  AMERICAN
nls_territory                        string  AMERICA

tstdb UID> select to_char(to_date('10:00 AM','hh:mi am')+2.5/24,'hh:mi am')
from dual
/

TO_CHAR(TO_DATE('10:00AM','HH:MIAM')+2.5/24,'HH:MIAM')
------------------------------------------------------
12:30 pm



[Updated on: Fri, 30 June 2006 15:06]

Report message to a moderator

Re: TO_CHAR problem ORA-01855 [message #180227 is a reply to message #180210] Sat, 01 July 2006 00:22 Go to previous messageGo to next message
wael890610
Messages: 17
Registered: June 2005
Location: Egypt-Ismaelia
Junior Member

this code is to explain my problem , that when i excute the previos statment i have "1/1/2006 10:00 am",and when i execute the statment "message(to_date('10:00 AM','hh:mi am');
at the devloper i have an ARABIC character not AM/PM.
>>> can i change this charcater to AM\PM without changing my NLS of developer?

Re: TO_CHAR problem ORA-01855 [message #180317 is a reply to message #180227] Mon, 03 July 2006 01:51 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
For anything associated with 'arabic' characters, search this forum for 'arab', and you will probably end up at http://www.araboug.org/ib/

David
Previous Topic: forms query slow - SQL*plus query fast
Next Topic: Module not loading
Goto Forum:
  


Current Time: Fri Sep 20 09:41:30 CDT 2024