Home » SQL & PL/SQL » SQL & PL/SQL » how to parse a string
how to parse a string [message #225049] Fri, 16 March 2007 14:58 Go to next message
lotusdeva
Messages: 198
Registered: March 2005
Senior Member
Really need help from you, gurus Smile

I have a procedure that accepts a string as its parameter. This string contains names that are separated with commas as follows:

'Scott, Brian, Anna, Stella, Daniel'

I need to parse this string as it comes into my procedure so that each name can be evaluated against employee_name column that is defined as VARCHAR(40) in the database. So I have a select in my procedure that looks like so:

SELECT employee_name
FROM employee
WHERE employee_name IN (this string parameter).

So the string needs to be parsed like this:

'Scott', 'Brian', 'Anna', 'Stella', 'Daniel' to be used in the select like

SELECT employee_name
FROM employee
WHERE employee_name IN ('Scott', 'Brian', 'Anna', 'Stella', 'Daniel');

Any ideas on how to go about it?

Thank you!



Re: how to parse a string [message #225051 is a reply to message #225049] Fri, 16 March 2007 15:05 Go to previous message
lotusdeva
Messages: 198
Registered: March 2005
Senior Member
ok, should have checked out askTom first.

nevermind Smile

http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2189860818012
Previous Topic: ORA-01033: ORACLE intialization or shutdown in progress
Next Topic: Please help me in using pivot and concatenate together.
Goto Forum:
  


Current Time: Sat Dec 03 01:06:33 CST 2016

Total time taken to generate the page: 0.19544 seconds