Re: Avoiding spooling to empty files

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 30 Jan 2009 19:16:17 -0700
Message-ID: <4983c281$1_at_news.victoria.tc.ca>



CenturionX (darwinbaldrich_at_gmail.com) wrote:
: Hello,

: I'm working with Oracle 10.2.0.4.0

: I have an unix script that via command line executes a query

: $ORACLE_HOME/bin/sqlplus -silent <<EOF
: connect user/pass_at_databse
: set pagesize 0
: set heading off
: set echo off
: set term off
: set feedback off
: set linesize 126
: spool /tmp/file_to_send
: SELECT * FROM table;
: EOF

: The issue is that if there is not data it generates a file with a
: control caracter (Don't know which one).

                    ^^^^^^^^^^^^^^^^^^^^

on usix, use od (octal dump) to examine the file.

I like

        od -a YOUR-FILE

(-a = show bytes using character notation, which is often easier to read)

$0.10 Received on Fri Jan 30 2009 - 20:16:17 CST

Original text of this message