Parse Full Name into First and Last Name attributes

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jhstephenson
Posts: 303
Joined: Wed Apr 22, 2015 11:44 pm

Parse Full Name into First and Last Name attributes

Post by Jhstephenson »

I have a Full Name attribute that I want to split into FirstName and LastName attributes. I thought I could use the WORDS_FROM_LEFT or WORDS_FROM_RIGHT functions to do this. But apparently they only work with Derby.

So, I am wondering what is the easiest way to do this in Aware?
rbross
Posts: 441
Joined: Wed Nov 19, 2014 4:13 am
Location: Coventry, Connecticut USA

Re: Parse Full Name into First and Last Name attributes

Post by rbross »

Hi Jim,

There is a way to do this but I forget the function. I did something similar when creating a numbers to words program.
If I remember right there is a function in Aware that will find the first space to split up two words in one attribute.

I will look for it and get back to you.
Roger Ross
AwareIM 8.7 (build 3025) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.5 (build 2828) ~ MS-SQL ~ Windows 10 ~
intra
Posts: 279
Joined: Thu Oct 11, 2012 1:30 pm
Location: Australia

Re: Parse Full Name into First and Last Name attributes

Post by intra »

Maybe something along the lines of this.

FullString = John Smith

Firstname = SUBSTRING(FullString, 0,INDEX_OF(' ',FullString))
Surname = SUBSTRING(FullString, INDEX_OF(' ',FullString),LENGTH(FullString))
Avid Linux user....
ACDC
Posts: 1151
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Re: Parse Full Name into First and Last Name attributes

Post by ACDC »

But apparently they only work with Derby.
I use this extensively in MySql
Jhstephenson
Posts: 303
Joined: Wed Apr 22, 2015 11:44 pm

Re: Parse Full Name into First and Last Name attributes

Post by Jhstephenson »

ACDC wrote:
But apparently they only work with Derby.
I use this extensively in MySql
That's interesting. This is what it says in Appendix B of the User Guide:

4. The following functions are supported only in Cloudscape/Derby database:
- WORD_NUMBER
- WORDS_FROM_LEFT
- WORDS_FROM_RIGHT
Last edited by Jhstephenson on Fri Sep 07, 2018 5:24 pm, edited 1 time in total.
Jhstephenson
Posts: 303
Joined: Wed Apr 22, 2015 11:44 pm

Re: Parse Full Name into First and Last Name attributes

Post by Jhstephenson »

intra wrote:Maybe something along the lines of this.

FullString = John Smith

Firstname = SUBSTRING(FullString, 0,INDEX_OF(' ',FullString))
Surname = SUBSTRING(FullString, INDEX_OF(' ',FullString),LENGTH(FullString))

Thanks, that works.
Jhstephenson
Posts: 303
Joined: Wed Apr 22, 2015 11:44 pm

Re: Parse Full Name into First and Last Name attributes

Post by Jhstephenson »

Jhstephenson wrote:
ACDC wrote:
But apparently they only work with Derby.
I use this extensively in MySql
That's interesting. This is what it says in Appendix B of the User Guide:

4. The following functions are supported only in Cloudscape/Derby database:
- WORD_NUMBER
- WORDS_FROM_LEFT
- WORDS_FROM_RIGHT


I also tried this and it works too. Apparently we aren't supposed to believe the documentation. :D
Post Reply