Solved

Print line in Spool file...

Posted on 2011-09-15
2
534 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
2 Comments
 
LVL 76

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

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…
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 information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

746 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