Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Unwanted Output When Querying Via Perl
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