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

Home -> Community -> Usenet -> c.d.o.server -> Stupid SQL question?

Stupid SQL question?

From: Jeremy <newspostings_at_hazelweb.co.uk>
Date: Tue, 8 Mar 2005 18:11:46 -0000
Message-ID: <MPG.1c97fae0de00e95e989db9@news.individual.net>


On 9iR2....

Is there a way to use th 'in' clause but comparing to a variable with string value such as

declare
  str varchar2(30) := 'A,B,C';
  i number;
begin
  select count(*)
  into i
  from mytab
  where col in str;
end;

Actually I know this isn't possible but can a similar effect to

..

where col in ('A','B','C')
..

be achieved without supplying a constant to the where clause - for example passing an aray of values for comparison? or do I need to build the SQL dynamically?

ta...

-- 

jeremy
Received on Tue Mar 08 2005 - 12:11:46 CST

Original text of this message

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