If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > string parsing

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-16-03, 04:45
g0pal g0pal is offline
Registered User
 
Join Date: Aug 2003
Posts: 14
string parsing

I have a string having name,value pairs. I want to parse this string and store it in a table. How to do this using Informix SQL?

String looks like this.
A1=aa1 A2=aa2 A3=aa3.

From this string I want to take out all A's and aa's and store them in a table. Like this

Table A
Name Value
------ -------
A1 aa1
A2 aa2
A3 aa3

Is it possible to do this in Informix SQL? Please help.

THanks,
Gopal
Reply With Quote
  #2 (permalink)  
Old 09-16-03, 07:53
Roelwe Roelwe is offline
Registered User
 
Join Date: Aug 2002
Location: Belgium
Posts: 534
If it has a fixed position, use String[1,2] etc...
__________________
rws
Reply With Quote
  #3 (permalink)  
Old 09-16-03, 07:56
Roelwe Roelwe is offline
Registered User
 
Join Date: Aug 2002
Location: Belgium
Posts: 534
The cleanest implementation would be to create a UDT for this type. You could create the appropriate functions to split the UDT into different types.

You also might want to check this site:
http://www7b.boulder.ibm.com/dmdd/zo...downloads.html

Lots of bladelets are available here. It is possible you find your solution in there.
__________________
rws
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On