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!

Using RPAD when parsing data

3017499Aug 21 2015 — edited Aug 21 2015

I already have the first name done using:  This is in the query

SELECT TBL.NAME...............,RPAD(SUBSTR( Micmls_Nat.Na_First_Last, 1, LOCATE( ' ', Micmls_Nat.Na_First_Last ) ), 48, ' ' )

Now I need to grab the last name from the same field Na_First_Last and pad it as well.

Here is the code I used to grab the last name: This is in the results, adding a computed column

if ( Instr ( Na_First_Last, ' ', 1, 1 )  != 0  ) { Ltrim(Substr(  Na_First_Last, Instr ( Na_First_Last, ' ', 1, 1 ) + 4 , 30) , ' ') }

Right now what is in the field looks like this:

Jose R        Viera

I don't care about the middle name.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2015
Added on Aug 21 2015
4 comments
435 views