0

I have a query called in a CSH script which is a simple select. I would like to write the result of the select statement in a a flat file but when i set the "SET HEADING OFF" and "SET FEEDBACK OFF", i get a blank line written to the flat file. When i executed the query in SQLPLUS and the settings off, i really had some spaces.

e.g.
SQL> SET HEADING OFF
SQL> SET FEEDBACK OFF
SQL> select employee_id||','||first_name||','||last_name row_list
> from employees;

191,Randall,Perkins
192,Sarah,Bell
193,Britney,Everett
194,Samuel,McCain
....

I got a blank in the first result where the column name used to reside. And in between the result set, i also get some blank lines because of the default page size. No matter how i set the page size, i still don't know how will i know how long the data/result will be, meaning at one point there will still be a blank space that will be written in the flat file. Is this something that can be set to SQLPLUS or in the CSH script??

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by wolverine_ramir
0

I am not using the SPOOL. This is how i take results from my select query in my CSH script:

$ORACLE_HOME/bin/sqlplus -s hr/hr@xe @write_to_file.sql > result.dat

Where write_to_file.sql contains:

set heading off
set feedback off

select employee_id||','||first_name||','||last_name row_list
from employees;

quit;

It is because when i used the SPOOL, it is also printing the SQL commands I executed in SQLPLUS. I need the flat file in some other programs as it is.

Thank you

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.