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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: sql query read from text file

RE: sql query read from text file

From: William Rogge <William_Rogge_at_voltek.com>
Date: Wed, 20 Jun 2001 07:39:05 -0700
Message-ID: <F001.003302FA.20010620073038@fatcity.com>

How about this simple script:

# Script to check processing
the_pids=`cat a.txt | awk '{printf("%s,",$1)}' | sed 's/,$//'` sqlplus / <<EoI
select x,y,z
  from abc
 where x in ($the_pids)
/
exit
EoI

Short and sweet and simple.

-----Original Message-----

From: Seema Singh [SMTP:oracledbam_at_hotmail.com] Sent: Tuesday, June 19, 2001 4:18 PM

To:     Multiple recipients of list ORACLE-L
Subject:        sql query read from text file

Hi
If i have one file a.txt and I want to put that content in where clause of sql statement then how can I do it.
Example :
a.txt content
98989
67676
898989
Select x,y,z from abc
where x in (98989,67676,898989)
/
Actuall I want to do it in unix.I want to know the first 2 or 3 high CPU using processes then by putting this pid we can get the oracle user name and what sql statement that oracle user are executing. if some have any similar kind of scripts let me know. Thanks
-Seema



Get your FREE download of MSN Explorer at http://explorer.msn.com

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Seema Singh
  INET: oracledbam_at_hotmail.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: William Rogge
  INET: William_Rogge_at_voltek.com
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Wed Jun 20 2001 - 09:39:05 CDT

Original text of this message

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