1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Spool PL/SQL output to files

Discussion in 'SQL PL/SQL' started by Shekhar81, Mar 5, 2009.

  1. Shekhar81

    Shekhar81 Active Member

    Likes Received:
    Trophy Points:
    hi, i know that there is the UTL_FILE package to spool output to file. So can someone please show me how I can spool pl/sql output to a file.

    Many thanks
  2. rajavu

    rajavu Forum Guru

    Likes Received:
    Trophy Points:
    @ Bangalore , India
    Actuall it depends on how and and where you want to write the PL/SQL OUTOPUT.

    As you know , UTL_FILE is the mostly recommended Way for that. The disadvantage is that you can read/write the file in the server. ie, you cant do it in the client side and you need to set the Directory and appropriate grants for read or write. The above link will give you a kick start.

    In case you want to write i you client PC , you can go for DBMS_OUTPUT.PT_LINE with SPOOL Command (Obviously along with SET SERVEROUTPUT ON Command in SQL*PLUS ). This can be done at server side also.