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 -> Re: Unwanted Output When Querying Via Perl

Re: Unwanted Output When Querying Via Perl

From: Steve Moreland <smoreland_at_clientserver.com>
Date: Thu, 25 Jun 1998 10:55:56 -0400
Message-ID: <35926781.0@news.one.net>


Try changing the sqlplus line to sqlplus -s scott/tiger\@database

HTH Ryan Rucker wrote in message <35910BD7.FCDD0451_at_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 Thu Jun 25 1998 - 09:55:56 CDT

Original text of this message

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