?
Solved

spool insert statement without select statement

Posted on 2011-10-26
2
Medium Priority
?
1,168 Views
Last Modified: 2012-05-12
Hello,

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

Thanks

bibi
0
Comment
Question by:bibi92
2 Comments
 
LVL 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 37032492
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
0
 

Author Closing Comment

by:bibi92
ID: 37032873
THANKS BIBI-
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

809 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