Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PL/SQL string tokenizer

Posted on 2003-11-08
4
Medium Priority
?
5,952 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 80 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

670 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