Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2011
    Posts
    25

    Question Unanswered: Can any one Tell me How to get column from Comma seperated Srting

    In Stored Procedure there is comma seperated string(ID) is Used
    How I can Use it in Where condition by Using "IN"

    E.g If i get i/p Like '1,2,3,4,5' in variable

    I want used that String like this

    Select * from Table
    Where ID IN(commaseperatedString);

    Plz give Solution
    Thanks,
    Vivek

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    "Varying elements in IN list" is a search term; here's what Tom Kyte says about it.

  3. #3
    Join Date
    Dec 2011
    Posts
    25

    Post

    reate or replace
    PROCEDURE "GET_STUDENT_CITYWISE"
    (

    IN_CITY_ID IN VARCHAR2, -- Comma sepereted Multiple CITY_ID
    OUT_RESULTSET OUT SYS_REFCURSOR
    )
    AS

    BEGIN

    BEGIN

    OPEN OUT_RESULTSET FOR
    SELECT STUDENT_NAME , STUDENT_EMAIL , STUDENT_MOBILE_NO, STUDENT_CITY
    FROM USER
    WHERE STUDENT_CITY IN(IN_CITY_ID)

    END;

    -- Handle exception
    EXCEPTION WHEN OTHERS THEN
    RAISE;

    END GET_STUDENT_CITYWISE;

    In the Above Student table STUDENT_CITY This Column having Number Datatype.
    I want the Result to Filter the Student on the basis of Cities (CommaSeperated)
    ??
    Last edited by Mr.Vivek; 12-06-11 at 11:02.

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    OK. What did you learn on Ask Tom?

  5. #5
    Join Date
    Dec 2011
    Posts
    25
    t's working now ! Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •