Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Posts
    3

    Unanswered: Passing a list to a stored procedure

    Hi,

    I have a cursor in a stored procedure, I want to add a where clause to the

    where id not in (1, 2, 3)

    I want to pass the (1, 2, 3) part as a parameter.

    Dose anyone have any sugestions on how I achive this.

    Thanks for any help,

    Chris

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1

    Re: Passing a list to a stored procedure

    Originally posted by wallacec
    Hi,

    I have a cursor in a stored procedure, I want to add a where clause to the

    where id not in (1, 2, 3)

    I want to pass the (1, 2, 3) part as a parameter.

    Dose anyone have any sugestions on how I achive this.

    Thanks for any help,

    Chris
    1) build the SQL statement in a VARCHAR2 variable
    2) execute this statement via "DYNAMIC SQL" (EXECUTE IMMEDIATE).

  3. #3
    Join Date
    Oct 2003
    Posts
    3
    Hi,

    Thanks for your reply.

    I thought about using dynamic SQL but not sure how to do that with a cursor, can I use dynamic SQL within the DECLARE section of a stored procedure.

    Thanks for your help

  4. #4
    Join Date
    Oct 2003
    Posts
    3
    Hi,

    Thanks for your reply.

    I thought about using dynamic SQL but not sure how to do that with a cursor, can I use dynamic SQL within the DECLARE section of a stored procedure.

    Thanks for your help

Posting Permissions

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