Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locate position of 8th ":" in text field and report on text

Status
Not open for further replies.

DrSmyth

Technical User
Jul 16, 2003
557
0
0
GB
Hi,

I'm reporting on a notes field that has 10 ":", the text after each ":" relates to a different aspect of the notes field. I need to report on the text after the 8th ":". I've got it to work by building about 16 UDO's and using them in unison e.g
first udo finds first ":" and then reports on string after that, second UDO finds first ":" in first UDO and reports on the string after that.

Although this works it takes an incredibly long amount of time to run. Can anybody think of an alternative solution?

I'm running 6.5 on a db2 database...

Thanks Dr [afro]
 
I have just done a similar exercise and had to create a separate variable in the universe for each word in my string. The process I used sounds similar to what you are doing, but if you are only after the text after the 8th ':' then why 16 UDO's?
Not sure if this helps but the syntax I used (using space char as the delimiter) is;

Substr(Field, Instr(Field, ' ', 1, 8)+1,
Instr(Field, ' ', 1, 8) - Instr(Field, ' ', 1, 7)))

So for you query substitute 'Field' for your field name and ' ' (space) for ':'.


 
Sounds like a good idea, think i was seperating the elimants of the query too musch (eg, UDO was using provious UDO to locate start of string...

I'll give this a go..

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top