Skip to Main Content

APEX

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!

UTL_FILE and APEX 20.1

Mary RJun 26 2020 — edited Jun 27 2020

Hello all

I am using Oracle XE 18c,Tomcat 9, ORDS 19.2.0.r1991647 and APEX 20.1 all on a single Windows 10 machine.

I have created two procedures. The first uses UTL_FILE to write the results of select * from emp to a csv file. The second is similar except it writes the results of select * from dept. The filenames are made up of the table name and todays date eg emp_26-JUN-2020.csv and dept_26-JUN-2020.csv  When I run the following anonymous block from SQL*Developer:

begin

     emp_proc;

     dept_proc;

end;

they work fine and I end up with the two files, right names and correct data inside them.

In APEX I have created a single button on a page that when clicked runs a plsql process with the same anonymous block as above. I don't get any errors - I only get

one file that is always called 2020.csv. The data inside the file is always the last procedure ie the dept table. What am I missing here please?  I am assuming that for some reason the filename is getting lost or shortened and as it is the same the second procedure over writes the results in it.

Any help greatly appreciated

Helen

This post has been answered by Mary R on Jun 27 2020
Jump to Answer
Comments
Post Details
Added on Jun 26 2020
4 comments
871 views