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 -> Dynamic query IN()-condition for cursor stored procedure

Dynamic query IN()-condition for cursor stored procedure

From: Bark Mark <bark_mark2003_at_yahoo.com>
Date: 31 May 2004 01:18:53 -0700
Message-ID: <17b5c308.0405310018.42601343@posting.google.com>


Hello,

I want a dynamic IN-condition for my cursor in a stored procedure... let's say it is comparable with this example :

SET SERVEROUTPUT ON DECLARE i PLS_INTEGER;
InStr VARCHAR2(20) := '10,30';

BEGIN
  SELECT COUNT(*)
  INTO i
  FROM emp
  WHERE deptno IN (InStr);

  dbms_output.put_line(i);
END;
/

this needs to return "9", but it returns a "0". If you use it with Instr = '10' it works, in all other cases I'm stuck with it...

Hope someone can help asap, it's a little bit urgent...

Thanks a lot

Bark Mark Received on Mon May 31 2004 - 03:18:53 CDT

Original text of this message

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