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: Query with contents of text file.

Re: Query with contents of text file.

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 27 Apr 2006 09:51:11 -0700
Message-ID: <1146156671.268445.243330@g10g2000cwb.googlegroups.com>

gazzag wrote:
> Harry331 wrote:
> > A little shell script will do.
> > Suppose you have a text file 'id.txt' containing the id's.
> >
> > $ seq 100 110 > id.txt
> > $ cat id.txt
>
> <--------------------------------------------------sniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiip--------------------------------->
>
> >Then plug your query to sqlplus.
> >
> > $ sqlplus user/password_at_whaever @myquery.sql
>
> A clasic, convoluted, over-complicated Unix solution. Nice. There may
> be many ways to skin the proverbial cat in a Unix environment, but
> you're still far better off with the right tool for the right job.
>
> As has already been mentioned in this thread, I'd recommend external
> tables. More appropriate, more intuitive, more readable.

OP never mentioned his/her Oracle version which means that you are assuming OP is on 9i and above and can thus use external tables.... and you know what they say about assumptions. Although I agree with you that Unix solution in this instance maybe a bit too much.

I like Brian's first reply which covers almost all Oracle versions.

Regards
/Rauf Received on Thu Apr 27 2006 - 11:51:11 CDT

Original text of this message

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