Solved

PL/SQL string tokenizer

Posted on 2003-11-08
4
5,940 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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
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 shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

685 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