How can I get date format in dd/mm/yyyy using dynamic PL/SQL query..?
I have tried so many options but nothing works. Can anybody suggest correct way get date of birth in below format (dd/mm/yyyy)
V_DYNAMICSQL := 'select to_char(a.dat_of_birth) Date_of_birth
from genmst_customer a'
Execute immediate v_dynamicsql;
to_charitself isn't enough - you should provide format model as well.Sample table:
PL/SQL procedure; note format model in line #5. I'm fetching only one row:
[EDIT], based on your comment.
If you want to use alias and refcursor, no problem. Here's an example: