View Single Post
  #13 (permalink)  
Old 07-06-09, 10:34
flyboy flyboy is offline
Registered User
 
Join Date: Mar 2007
Posts: 545
Quote:
Originally Posted by sunsail
I donot know why but I posted an email in this thread to epxlain situation ,and now I cannot see that post,did I mispost it?
I have no idea, I received only this reply.
Quote:
Originally Posted by sunsail
Now I can get results with trunc function in

trunc(send_date)=trunc('01-022009')

format as I was used to get.
Congratulations; anyway the code you posted 'does not work' for me:
Code:
SQL> select trunc('01-022009') from dual;
select trunc('01-022009') from dual
             *
ERROR at line 1:
ORA-01722: invalid number


SQL>
Quite expected result, as TRUNC function accepts only numeric or datetime type parameters, not strings. And conversion to both types fails for '01-022009', as it does not represent any number nor date.
The only reasonable explanation is, that you post here some kind of pseudocode. Please do not do it: it is very misleading to all readers. In fact, the first thing anybody will do, is correcting this rubbish instead of finding solution(s) for your problem.
Quote:
Originally Posted by sunsail
ps:I didnot create table structure therefore I donot know why "ss.sssss" is used.
As you could see my example, I did not create any table structure too.
It is all about converting VARCHAR2 literal into TIMESTAMP. And knowing, what the string representation ('17-APR-0902.34.26.637000000PM') means.
Anyway, using 'SS.SSSSS' was the reason of the ORA-01855 error.

[edit: Added the remark about ORA-01855]

Last edited by flyboy; 07-06-09 at 11:08.
Reply With Quote