Solved

PL/SQL string tokenizer

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Space Delimited Sql File 4 70
oracle global variables 4 51
oracle query 15 63
Concat multi row values of a field in oracle 6 35
Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
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 …
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now