Solved

Print line in Spool file...

Posted on 2011-09-15
2
543 Views
Last Modified: 2012-05-12
I'm trying to write a batch file to execute some sql in sqlplus that will generate a flat file. I would like to be able to insert a couple of lines of text at the beginning of the file but am having a problem finding the correct way to do it, can someone help?

I'm trying to use dbms_output.put_line but fear I'm using it incorrectly...

 My sql script...

set feedback off
set verify off
set head off
set echo off
set linesize 30
set pages 0
set serveroutput on

spool W:\scripts\Wk1.csv

dbms_output.put_line('test');

SELECT * from table 1;

spool off
quit
0
Comment
Question by:nike_golf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 36546924
Dbms_output is a pl/sql command.

In sqlplus what you want is PROMPT:

Spool W:\scripts\Wk1.csv

Prompt test

SELECT * from table 1;

spool off
0
 
LVL 13

Author Closing Comment

by:nike_golf
ID: 36547018
Exactly what I needed.

Thanks for the quick reply.

NG,
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

688 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