spool insert statement without select statement

Posted on 2011-10-26
Last Modified: 2012-05-12

I want to spool insert statement when I execute this query without having select statement.


Question by:bibi92
    LVL 76

    Accepted Solution

    Do not copy/paste the select into sqlplus.

    Create a script, say myscript.sql with:
    set lines 1000
    set pages 0
    set trimspool on
    set feedback off

    spool myoutput.sql
    select ' insert into ' from table_name ...
    spool off

    Then execute the script in sqlplus:
    SQL> @myoutput

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
    From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
    This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now