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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PL/SQL QUESTION 1

Status
Not open for further replies.

nouf

Programmer
Oct 8, 2003
26
QA
HI,,
I WANT TO DEVIDE A STRING INTO SUBSTRINGS LIKE THE FOLLOWING
MAIN STRING 'HI IAM NOUF'
----
I WANT OT DEVIDE IT INTO
HI
IAM
NOUF
 
Given that a space is what separates the data that you require.

Capture the length of the string.

Use a LOOP structure and exit when you have reached the length of the string. So, read it character by character by using the SUBSTR command. Once a space is found, output the characters found. Repeat this process until you get to the end of the string.
 
...Or
Code:
select translate('HI IAM NOUF',' ',chr(10)) from dual;

TRANSLATE('
-----------
HI
IAM
NOUF

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 15:59 (16Feb05) UTC (aka "GMT" and "Zulu"),
@ 08:59 (16Feb05) Mountain Time

Do you use Oracle and live or work in Utah, USA? Then click here to join Utah Oracle Users Group on Tek-Tips.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top