Tags: database, file, mysql, oracle, query, select, spool, spooled, sql, sqlplus, string, stringi, strings

SQLPlus - How to spool without query string?

On Database » Oracle

2,906 words with 5 Comments; publish: Mon, 19 May 2008 14:59:00 GMT; (25062.50, « »)

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.

All Comments

Leave a comment...

  • 5 Comments
    • 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

      #1; Mon, 19 May 2008 15:00:00 GMT
    • 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

      #2; Mon, 19 May 2008 15:01:00 GMT
    • Seek!!

      http://www.ss64.com/orasyntax/plus_set.html

      "Noel" <tbal.oracle.itags.org.go2.pll-l> wrote in message

      news:dgtspl$5mh$1.oracle.itags.org.inews.gazeta.pl...

      > User ISA wrote:

      >

      > You could also add "set pages 0" to eliminate empty line after each page.

      > --

      > Noel

      #3; Mon, 19 May 2008 15:02:00 GMT
    • 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.oracle.itags.org.x.washington.edu

      (replace x with u to respond)

      #4; Mon, 19 May 2008 15:03:00 GMT
    • Thank you, all.

      It works perfectly.

      But when I try this, I had to make *.sql script file

      and run like "sqlplus user/passwd .oracle.itags.org.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

      >

      #5; Mon, 19 May 2008 15:04:00 GMT