Link to home
Start Free TrialLog in
Avatar of Regulapati
Regulapati

asked on

Oracle Spool question

Hi all Experts,

I want to spool the result to a file whcih I was able to do but I donot want the select string and
X rows selected, Spool off to be showed up on the file..


EX :
Select * from X; ( SHOULD NOT SHOW)

A   B (ONLY THIS (DATA) HAS TO SHOW ON THE FILE)

1 row selected (Should not show)
Spool off (Should not Show)

Any help is appriciated.

Thanks in advance

Thanks
Madhavi





Avatar of flevyhara
flevyhara

Try:

SET NEWPAGE 0
SET SPACE 0
SET PAGESIZE 0
set linesize 1024
SET ECHO OFF
SET FEEDBACK OFF
SET HEADING OFF
Actually, some of the lines remain.

Try, (from command line, not from SQLPLUS):

sqlplus -s username/password @test

and on the test.sql file:
SET NEWPAGE 0
SET SPACE 0
SET PAGESIZE 0
SET ECHO OFF
SET FEEDBACK OFF
SET HEADING OFF
select * from dual;
exit;
Avatar of Regulapati

ASKER

HI flevyhara,


I tried this but sill getting my select string in the file..
Do I need to do anything else
This is what has been showd on the file
SELECT * FORM TABLE; ( DONOT WANT THIS)
ROWS ( WITH OUT HEADINGS)
Spool OFF;

Thanks
Madhavi
I use these set commands, some of them may be same as in the previous comment but I dont get the script lines out. The COLSEP setting will remove the default column separator of one space.

set PAGESIZE 0
set COLSEP ''
set TERMOUT off
set WRAP on
set VERIFY off
set HEADING off
set SHOWMODE off
set feedback off
spool c:\test.log
SELECT * from X;
spool off
HI flevyhara,
 
I will try the second one on Monday and will let you know

Thanks again

Madhavi
Hi Flevyhara,

I tried your second option from command line it is running with out any errors but I could not see
where it is creating the output file, can I give any parameters to specify where to create the
out put file

Thanks
Madhavi
Hi SDutta,

I tried your lines of code but it is still spooling the query also.

EX:

SQL> select * from Dual;
X                                                                                                  
SQL> spool off;

This what it showd up in the spool file.
I just want to see the "X" in the file

Thanks
Madhavi




Also try setting
SET ECHO OFF
ASKER CERTIFIED SOLUTION
Avatar of SDutta
SDutta

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi SDutta,

Thanks for your help. It worked


Thanks
Madhavi.R