02-02-12, 02:56 #1Registered User
- Join Date
- Jan 2012
Unanswered: How to split comma separated varchar input parameter in stored procedure?
I am trying to pass varchar as input parameter in my stored procedure. This varchar has comma separated values. For e.g.
name is my varchar input parameter having values -
'name1, name2, name3, name4, name5'
I want to split these values in stored procedure and to retrieve these values in an array. I am using db2 8.2. How to do it?
As per my knowledge I can't create user-defined array type in db2 8.2. So I am trying to take all values as comma separated in single varchar variable and as input parameter, passing through the stored procedure. Now I want this splitted values in simple varchar array. Please provide me some solution over this.
I really appreciate your help.
Last edited by prodigy201; 02-02-12 at 03:11.
02-02-12, 04:16 #2Registered User
- Join Date
- Jan 2007
- Jena, Germany
I won't even bother explaining that this is an FAQ and a little bit of search would turn up, for example: Parsing Strings in SQLKnut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development