Re: A Question

From: joel garry <joel-garry_at_home.com>
Date: Fri, 29 May 2009 11:01:13 -0700 (PDT)
Message-ID: <111a95e2-7ba9-4c41-ba70-e5e2f13a6be0_at_e21g2000yqb.googlegroups.com>



On May 29, 7:13 am, Wudong <wudong...._at_gmail.com> wrote:
> Dear All:
> I have a question on Oracle.
> Basically I have a file with each row is an ID to a row in the
> database. I need to retrieve all the rows with the ID in that file.
> What will be the best way to do that? I'm wondering if Oracle have a
> tool that could possibly help the process because I feel it's quite
> common task..:)
>
> many thanks.
> Wudong

If it's a small file, you can process it like (untested, off the top of my head, there are better ways, depending, just curious if I could do it as a one-liner aside from wrapping):

awk 'BEGIN {print " set verify off echo off feedback off pages 0 heading off termout off" ;print "select * from yourdbtable where youridentifier in (" } {print "\047" $1"\047"} END {print"\047somethingnotpossible\047)"}' < yourfile > yoursqlcommand.sql

Once tested, you could replace the redirected output with a pipe to sqlplus.

jg

--
_at_home.com is bogus.
http://voices.washingtonpost.com/securityfix/2009/05/the_scrap_value_of_a_hacked_pc.html
Received on Fri May 29 2009 - 13:01:13 CDT

Original text of this message