Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get 4 digit year in pl/sql?

user565033Dec 13 2007 — edited Dec 14 2007
select TO_DATE ('99991231', 'yyyymmdd')
from dual;

The above query gives output as --> 12/31/9999

but using the same in pl/sql it gives --> 31-DEC-99


declare
v_date varchar2(12) := '99991231';
v_tmp date;
begin
select TO_DATE (v_date, 'yyyymmdd') into v_tmp
from dual;
dbms_output.put_line(v_tmp);
end;

I would like to see 12/31/9999 in pl/sql. How can i do this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 11 2008
Added on Dec 13 2007
6 comments
5,950 views