Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2010
    Posts
    13

    Unanswered: How to pass multiple parameters to a procedure

    I have a procedure called 'ReIndex' and it takes 1 parameter called 'TName'

    I want to be able to pass multiple values to TName, but not sure what the best practice to do this would be.

    Should I just comma separate the parameters into the TName param, and then split them based on the ','?

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Should I just comma separate the parameters into the TName param, and then split them based on the ','?
    Place table_name as separate rows in a table & have procedure iterate through them
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Mar 2007
    Posts
    623
    The only reasonable way is to ask the vendor of 'ReIndex' procedure, whether it accepts multiple values in 'TName' parameter. It would also be nice to know all data types accepted in 'TName'.

    You might still call it multiple times or in a loop, depending on values required for 'TName'.

  4. #4
    Join Date
    Aug 2010
    Posts
    13
    Ok I'll give those two things a shot. TName will always contain String (varchar) values so that's good. I guess there isn't a general best practice for this so I'll just use the best way to get around this.

  5. #5
    Join Date
    Aug 2010
    Posts
    13
    How do I go about parsing out the multiple valued parameter? Sorry, but I'm still a little new to writing procedures.

    I'd have something like TName = "'m_msg','m_msg_cond'"

    how would I parse through those to insert into a temp table?

  6. #6
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Sorry, but I'm still a little new to writing procedures.
    What programming experience do you have?

    LOOP

    use INSTR() & SUBSTR() functions
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  7. #7
    Join Date
    Aug 2010
    Posts
    13
    alright I'll use those and figure it out. I'm a java developer but am starting to get into oracle procedures now to help out

Posting Permissions

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