fetch value from comma seperated string
I have a variable myvar char(100).
I have assign a value to it myvar='abc,bb,xft,gty'
First I want to check how many , are there in this variable.
second I want to get the value from this variable before each comma like:
I am working on db2 databse.
I know nothing about DB2, but here's how to do it in SQL Server: http://www.google.com/search?q=sql+c...rray+parameter . Perhaps the same methods will work in DB2?
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Fetch Values from Comma Deliminated String
Here is how I do it.
Dim aInfo As Array
'set aInfo to variable returned from db2 then...
aInfo = strData.Split(",")
If aInfo.Length < 0 Then
Throw New Exception("Missing data ")
If IsNothing(aInfo(0).ToString.Trim) Then
gECnbr = " "
gECnbr = aInfo(0).ToString
Me.txtReason.Text = "EC" & gECnbr.TrimEnd
If IsNothing(aInfo(1).ToString.Trim) Then
gECrev = " "
gECrev = aInfo(1).ToString
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL