Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Print line in Spool file...

Posted on 2011-09-15
2
Medium Priority
?
555 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 2000 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

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

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…
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…
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…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

609 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