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!

Spool to local client machine

DDFMay 7 2014 — edited May 8 2014

Hi gurus,

I need to spool the results of an anonymous PL/SQL block on the client where I execute the Sql Developer, to be able to semi automate a data extraction.

I have no access to the DB server, I can only connect with sql, so I can't (I think) use the UTL_FILE procedures.

The export is a quaite big amount of data, so if I use something like the following code it rise the buffer overflow error:

Spool myfile.csv

  begin

   SELECT daty, year  BULK COLLECT INTO col_date_day, col_date_year FROM my_table

    FOR i IN col_date_day.FIRST .. col_date_year.LAST

      LOOP

        DBMS_OUTPUT.PUT_LINE(col_date_day(i) ||   ',' || col_date_year(i));

      END LOOP;

  end;

  /

  spool off

 

I need a PL/sql with loops because my logics is a little bit more complex than the examples.

Is there any way to efficently spool on my local machine?

Or there is some way to use the seme funcion of the export Sql developer expose from user interface to do it?

Thanks in advance!

Daniele

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2014
Added on May 7 2014
7 comments
5,414 views