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:[EMAIL PROTECTED]]
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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to