Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Split a value separated by space

myCloudNov 19 2018 — edited Nov 20 2018

I would like to extract each of the words in a string/value and print them as given below :-

WITH get_str

     AS (SELECT 'Porter Care Adventist Health Systems DBA Littleton Adventist Hospital'

                   txt

           FROM DUAL

         UNION

         SELECT 'Sample string for the query' txt FROM DUAL

         UNION

         SELECT 'Smith Carter Architects - Engineers, Inc. (US)' txt

           FROM DUAL

         UNION

         SELECT 'Avenue of the Americas Development Company LLC.' txt

           FROM DUAL)

SELECT *

  FROM get_str

Expected output should be :-

String1String 2String 3String 4String 5String 6String 7String 8String 9TXT
PorterCareAdventistHealthSystesDBALittletonAdventistHospitalPorter Care Adventist Health Systems DBA Littleton Adventist Hospital
SampleStringfor the querySample string for the query
SmithCarterArchitects-Engineers,Inc.(US)Smith Carter Architects - Engineers, Inc. (US)
AvenueoftheAmericasDevelopmentCompanyLLCAvenue of the Americas Development Company LLC.
This post has been answered by mathguy on Nov 19 2018
Jump to Answer
Comments
Post Details
Added on Nov 19 2018
8 comments
1,757 views