Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Unwanted Output When Querying Via Perl

Unwanted Output When Querying Via Perl

From: Ryan Rucker <rxruck2_at_uswest.com>
Date: Wed, 24 Jun 1998 09:23:19 -0500
Message-ID: <35910BD7.FCDD0451@uswest.com>


Hello,

I'm not quite sure if this is more of an SQL question or a Perl question, so I'm starting here first.

I have this bit of Perl code (on a Unix box) that I use to connect to an Oracle database, run a query, and produce a text file of the results:

open(SQLPLUS, "| sqlplus scott/tiger\@database") or die ("Couldn't run SQL*PLUS:$!");

# grab rows from all_customers

print SQLPLUS <<BYE;
set heading off
set termout off
set echo off
set feedback off
spool /tmp/customers.txt
select customer_id, customer_name from all_customers; spool off
exit
BYE close(SQLPLUS) or die ("Couldn't stop SQL*PLUS:$!\n");

It runs all right and produces the file, but the output that I get (customers.txt) looks like this:

SQL> select customer_id, customer_name from all_customers;

          100000
BIG JIM'S TIRE AND BATTERY           100001
BUZZY BEE CAFE SQL> spool off

I'm trying to find a way to suppress the two SQL> lines. In other words, I just want the data, not the SQL statements also.

Any ideas on why this is happening and how to prevent it is appreciated.

Ryan Received on Wed Jun 24 1998 - 09:23:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US