Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: LTRIM & RTRIM
... unless you specify the FM (fill mode) toggle in your format string: SQL> select to_char(mydate, 'fmDAY') "DAY", 2 length(to_char(mydate, 'fmDAY')) "LENGTH" 3 from (select sysdate + rownum - 1 mydate
4 from v$parameter 5 where rownum <= 7); DAY LENGTH --------- -------- MONDAY 6 TUESDAY 7 WEDNESDAY 9 THURSDAY 8 FRIDAY 6 SATURDAY 8 SUNDAY 6
7 rows selected.
kind regards,
Lex.
-----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On
Behalf Of Stephane Faroult
Sent: Monday, March 21, 2005 08:46
To: jacintakean_at_yahoo.com
Cc: oracle-l_at_freelists.org
Subject: Re: LTRIM & RTRIM
Day formats have a fixed length:
1 select to_char(mydate, 'DAY') "DAY",
2 length(to_char(mydate, 'DAY')) "LENGTH"
3 from (select sysdate + rownum - 1 mydate
4 from v$parameter
5* where rownum <= 7)
SQL> / DAY LENGTH
MONDAY 9 TUESDAY 9 WEDNESDAY 9 THURSDAY 9 FRIDAY 9 SATURDAY 9 SUNDAY 9 7 rows selected.
Kean Jacinta wrote:
>Need some clarification here.
>
>WHILE V_FROMDate <= TODATE LOOP
> IF RTRIM(TO_CHAR(V_FROMDate,'DAY'))='SATURDAY' THEN
> V_Count := V_Count + 1;
> END IF;
> V_FROMDate := V_FROMDate +1;
>
>When i use RTRIM --it will generate correct result , if i use LTRIM
>then the system will return 0.
>
>Aren't RTRIM and LTRIM sort of the same ?
>
>PLs help up . THank u
>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Small Business - Try our new resources site!
>http://smallbusiness.yahoo.com/resources/
>--
>http://www.freelists.org/webpage/oracle-l
>
>
>
-- Regards, Stephane Faroult RoughSea Ltd http://www.roughsea.com -- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-lReceived on Mon Mar 21 2005 - 03:18:56 CST