Page 1 of 1

3 character abbrevation for month in date

Posted: Fri Aug 22, 2008 6:58 am
by Deepakinstyle
Hi All,

My input is sysdate from dual table(i am using ORACLE enterprise stage).
next stage i have a transformer where i am passing some hardcoded message and concatinating this date(sysdate) to one stored procedure stage, which will pass the above message to some table. The message should appear as eg: if sysdate is 22/08/2008 and my message should be xxxxyyyy for 22-AUG-2008.

please give your inputs.

Thanks,
Deepak

Posted: Fri Aug 22, 2008 7:07 am
by chulett

Code: Select all

select to_char(sysdate,'DD-MON-YYYY') from dual

Posted: Fri Aug 22, 2008 7:27 am
by Deepakinstyle
chulett wrote:

Code: Select all

select to_char(sysdate,'DD-MON-YYYY') from dual
...
Thanks Chulett.

I got the required format but now i have DD-mon-YYYY.
can i get the output as DD-MON-YYYY

Posted: Fri Aug 22, 2008 7:31 am
by chulett
:? My example showed that. "MON" = upper-case three character month, "mon" = lower-case. Pick whichever you like.

Posted: Fri Aug 22, 2008 7:43 am
by Deepakinstyle
chulett wrote::? My example showed that. "MON" = upper-case three character month, "mon" = lower-case. Pick whichever you like. ...
I got month as MON from dual. but when i have inserted this date into the table there am getting as 22-aug-2008.

can i have this as 22-AUG-2008

Thanks,
Deepak

Posted: Fri Aug 22, 2008 7:57 am
by Deepakinstyle
Deepakinstyle wrote:
chulett wrote::? My example showed that. "MON" = upper-case three character month, "mon" = lower-case. Pick whichever you like. ...
I got month as MON from dual. but when i have inserted this date into the table there am getting as 22-aug-2008.

can i have this as 22-AUG-2008

Thanks,
Deepak
Thanks Chulett. I got it correct finally.

Thanks for your suggestions

Posted: Fri Aug 22, 2008 8:00 am
by chulett
Ok, good. Saves me from going into my lecture on how Oracle dates are not stored in any format and what they look like when selected is up to you or your tool of choice. :wink:

Posted: Fri Aug 22, 2008 4:56 pm
by ray.wurlod
Has anyone else noticed that Oracle is an anagram of "Orc Ale"? And is occasionally misspelled thus?

Posted: Fri Aug 22, 2008 5:09 pm
by chulett
:lol: No, can't say that I have.