Results 1 to 4 of 4

Thread: Spooling in SQL

  1. #1
    Contributing Member
    Join Date
    May 2006
    Answers
    72

    Spooling in SQL

    I want to know about spooling procedure or concept in SQL.I want to write records into sql file so some tips on spooling procedures and commands would help me to achieve the concept.


  2. #2
    Expert Member
    Join Date
    Sep 2006
    Answers
    130

    Re: Spooling in SQL

    SPOOL is a SQL*Plus command which helps to write into a file.
    If the extension is not given, then the file extension will be .lst
    The command, "SPOOL IN" in SQL prompt will create a file IN.lst & will be in open state till the command "SPOOL OFF".
    Instead of IN, if the file name with extension is given like "SPOOL testfile.sql", then the file testfile.sql will be create.
    The command "SPOOL OUT" will print the file which has been generated.

    *** Mangai Varma ***


  3. #3
    Contributing Member
    Join Date
    Dec 2006
    Answers
    39

    Re: Spooling in SQL

    eg:
    spool file
    select * from my_table
    spool off

    All Output records will come to ur file


  4. #4
    Junior Member
    Join Date
    Jan 2007
    Answers
    21

    Re: Spooling in SQL

    One more thing, I wud like to add here...
    It is common concern to remove the heading of columns while generating the extract using spool command... it was a real scenario in my project...
    to remove the heading, we can use-
    set head off
    spool &p_spool_file
    select * from emp;
    spool off;
    set head on


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact