Solved

PL/SQL string tokenizer

Posted on 2003-11-08
4
5,947 Views
Last Modified: 2013-12-12
Hi all,
I should need a character function which, given a string and a
specific token, gives me back all the substrings.
Then I should load all these substring into a poplist (Forms 6i element).

So, given the string 'foo1,foo2,foo3' the poplist should contain:
foo1
foo2
foo3

I didn't find any suitable PL/SQL function to do this. Does it exist ?
If not, I have no idea of which functions I should use!


I'd appreciate any help,
Best
Irene
0
Comment
Question by:iz_a8_irene
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 12

Expert Comment

by:catchmeifuwant
ID: 9712838
what is your string and a token...give some examples of input and the output expected !!!
0
 
LVL 3

Accepted Solution

by:
jaramill earned 20 total points
ID: 9855090
Irene:

  First you have to determine what will be your delimiter (i.e. a comma, a pipe, etc...).  In your case it's a comma.  Then you write a function that takes in the string and you then look for the position of the first instance of the delimiter, then calculate the first token based on starting postion 1..to..delimiter.  Then move the pointer 1 passed the delimiter and search for the next delimiter, then calculate the second token based on starting postion delimiter+1..to..second_delimiter.  Repeat this process until you are at the end of the string.  While getting each token, you can add it to a PL/SQL array and return that array, then use it to populate a table which will then read it from a RECORDGROUP which will then populate a ListOfValues.

Gio
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 10200383
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept jaramill's comment as answer.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Henka
EE Cleanup Volunteer
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question