declare
v_date date;
CURSOR abc
is
select a_date
from abc
where part_id ='E00000001';
begin
open abc;
fetch abc into v_date;
close abc;
dbms_output.put_line('date is '||v_date);
end;
/
Here my date that is been fetched is ’31/12/2099 23:59:59′,Now the issue is that when i fetch this into v_date using cursor its coming ….date is 31/DEC/99
What may be the issue
I am using oracle as RDBMS
I see one thing that bothers me with your code –
abcis the name of the table and of the cursor… that’s bad practice IMHO.As for the date format problem try
The output you see is most probably the result of some db/session-level NLS setting regarding the date format which is used when converting a
DATEto aVARCHAR2. My code uses an explicit date format to work independently of that setting (which is NOT ideal since it might make it problematic in situations where localization/globalization is needed!).