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 -> Re: Is it possible to use bind variables with an 'IN'

Re: Is it possible to use bind variables with an 'IN'

From: Kenny Yu <kyu_at_biodiscovery.com>
Date: Mon, 27 Jan 2003 17:27:02 -0800
Message-ID: <v3bmvt4bsum448@corp.supernews.com>


I see no need for the in-list nor the dynamic sql. The resource id's must be from a sql. ALl you need is

DELETE FROM RD_ASSOC_CONTAINER_TEST
WHERE RESOURCE_ID IN
(
  select resource_id from a_table
)

Kenny


"Ryan Gaffuri" <rgaffuri_at_cox.net> wrote in message news:1efdad5b.0301270557.57a0b694_at_posting.google.com... the first part is simply looping through a PL/SQL table and building a comma-delimited string of files I want to use in my 'IN' statement.

FOR i IN l_resourceID.FIRST.. l_resourceID.LAST

    LOOP

      IF v_resourceidString IS NOT NULL
      THEN
       v_resourceidString  := v_resourceidstring
||','||to_char(l_resourceID(i).RESOURCE_ID);
        (i).RESOURCE_SEQ);
      ELSE v_resourceidString  := l_resourceID(i).RESOURCE_ID;

      END IF;
-----------------------------------------------------------------
Oracle cant parse what is below.
 EXECUTE IMMEDIATE 'DELETE FROM RD_ASSOC_CONTAINER_TEST'||
                      'WHERE RESOURCE_ID IN (:1)'

  using v_resourceidString;

Oracle cant parse this properly. Is there a way to do this with bind variables? I have done this before when I had to get a list of column names to search and put them in the 'SELECT' clause without bind variables? Received on Mon Jan 27 2003 - 19:27:02 CST

Original text of this message

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