View Full Version : SQLPlus - How to spool without query string?
Son KwonNam
09-21-2005, 12:21 AM
Hello,
When I spool select query results with SQL*Plus,
It always add query strings to the spooled file.
How to spool without query string?
I need to use the spooled file in a cron job.
But because the spooled file has garbage strings, it's very difficult to
use that.
Regards,
KwonNam.
Hi:
you can put at the beginning of the select:
set termout off
set arraysize 5
set echo off
set verify off
set heading off
This removes all the text from the query result. Only remains the
values of the select
I hope it's usefull to you.
Regards,
Isa
User Isa wrote:
Hi: you can put at the beginning of the select: set termout off set arraysize 5 set echo off set verify off set heading off
You could also add "set pages 0" to eliminate empty line after each page.
--
Noel
Seek!!
http://www.ss64.com/orasyntax/plus_set.html
"Noel" <tbal@go2.pll-l> wrote in message
news:dgtspl$5mh$1@inews.gazeta.pl... User Isa wrote: Hi: you can put at the beginning of the select: set termout off set arraysize 5 set echo off set verify off set heading off You could also add "set pages 0" to eliminate empty line after each page. -- Noel
DA Morgan
09-23-2005, 03:36 PM
Isa wrote: Hi: you can put at the beginning of the select: set termout off set arraysize 5 set echo off set verify off set heading off This removes all the text from the query result. Only remains the values of the select I hope it's usefull to you. Regards, Isa
Why arraysize 5? That should do nothing but slow down the query
by quite a bit. I'd suggest you try with an arraysize of 100-200
as a general rule.
--
Daniel A. Morgan
http://www.psoug.org
damorgan@x.washington.edu
(replace x with u to respond)
Son KwonNam
09-25-2005, 10:37 PM
Thank you, all.
It works perfectly.
But when I try this, I had to make *.sql script file
and run like "sqlplus user/passwd @test.sql"
It did not work interactively on sql*plus.
Anyway that's what I exactly wanted.
Thanks again.
Isa wrote: Hi: you can put at the beginning of the select: set termout off set arraysize 5 set echo off set verify off set heading off This removes all the text from the query result. Only remains the values of the select I hope it's usefull to you. Regards, Isa
Son KwonNam
09-25-2005, 10:43 PM
When I tried another query which has alot of result rows,
it did not have any query string but, it had the following line.
--------------------------
99 rows selected.
--------------------------
Is it possible to remove that line?
Thanks.
~
Son KwonNam 쓴 글: Thank you, all. It works perfectly. But when I try this, I had to make *.sql script file and run like "sqlplus user/passwd @test.sql" It did not work interactively on sql*plus. Anyway that's what I exactly wanted. Thanks again.
User Son KwonNam wrote: When I tried another query which has alot of result rows, it did not have any query string but, it had the following line. -------------------------- 99 rows selected. -------------------------- Is it possible to remove that line?
SET FEEDBACK OFF
--//**
SQL> select * from cat where rownum = 1;
TABLE_NAME TABLE_TYPE
------------------------------ -----------
AA TABLE
SQL> set feedback on
SQL> /
TABLE_NAME TABLE_TYPE
------------------------------ -----------
AA TABLE
1 row selected..
SQL> set feedback off
SQL> /
TABLE_NAME TABLE_TYPE
------------------------------ -----------
AA TABLE
SQL>
--
TomekB tbal@go2.pl-l
MyLounge.com Site Map
Forum:
Cars,
Cell Phone,
Database,
Games,
Home Improvement,
IT,
Music,
School,
Sports,
Web Design,
Web Server,
Weight Loss
The MyLounge.com forum is intended for informational use only and should not
be relied upon and is not a substitute for any advice. The information contained
on MyLounge.com are opinions and suggestions of members and is not a representation
of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for
the accuracy, completeness or usefulness of any postings or the qualifications
of any person responding. Please consult a expert or seek the services of an
attorney in your area for more accuracy on your specific situation. Please note
that our forums also serve as mirrors to Usenet newsgroups. Many posts you see
on our forums are made by newsgroup users who may not be members of MyLounge.com
Term of Service
vBulletin v3.0.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.