You get a timestamp format because the nls_date_format is defined with this format on the server side.
You have many solutions to solve your pb :
1/ select to_char(sysdate,'DD/MM/YYYY') from dual;
but it this return a varchar2 string.
2/ if you need the system date as a date :
select to_date(to_char(sysdate,'DD/MM/YYYY'),'DD/MM/YYYY') from dual;
NB : if you work on a indexed date field in a query using to_char(sysdate,...) or a to_date(to_char(sysdate,...)) , you will not used the index on the date field.
3/ Another solution is to alter your session on the client side (your SQL+ session):
alter session set nls_date_format ='DD/MM/YYYY'
and then call the PL/SQL commands.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.