#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    1
    Rep Power
    0

    The IN clause and Stored Procs


    I want to pass a variable into a stored proc from a VB dll that is a comma delimited string and put this variable into an IN clause like below.

    PROCEDURE GetFolders (i_FOLDERS IN VARCHAR2)
    IS
    BEGIN
    OPEN MyCursor FOR
    SELECT MyTable.*
    FROM MyTable
    WHERE MyTable."Folder" IN (i_FOLDERS);
    END GetFolders;

    The problem is that no matter what I do it always treats this variable as one big string and does not treat my comma separated folder names in the input as separate, but as one big string. It doesn't matter if I put single or double quotes around the folder names in my variable either. It works fine with just one folder name, but not right with comma delimited folder names. Is there any way to get it to treat my comma delimited input treated as separate values for the IN clause?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2002
    Posts
    693
    Rep Power
    26
    can't do it that way... you need to use execute immediate or dbms_sql (depending on which version of Oracle)

IMN logo majestic logo threadwatch logo seochat tools logo