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?
Parse Full Name into First and Last Name attributes
-
- Posts: 303
- Joined: Wed Apr 22, 2015 11:44 pm
Re: Parse Full Name into First and Last Name attributes
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.
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 ~
AwareIM 8.7 (build 3025) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.5 (build 2828) ~ MS-SQL ~ Windows 10 ~
Re: Parse Full Name into First and Last Name attributes
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))
FullString = John Smith
Firstname = SUBSTRING(FullString, 0,INDEX_OF(' ',FullString))
Surname = SUBSTRING(FullString, INDEX_OF(' ',FullString),LENGTH(FullString))
Avid Linux user....
Re: Parse Full Name into First and Last Name attributes
I use this extensively in MySqlBut apparently they only work with Derby.
-
- Posts: 303
- Joined: Wed Apr 22, 2015 11:44 pm
Re: Parse Full Name into First and Last Name attributes
That's interesting. This is what it says in Appendix B of the User Guide:ACDC wrote:I use this extensively in MySqlBut apparently they only work with Derby.
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.
-
- Posts: 303
- Joined: Wed Apr 22, 2015 11:44 pm
Re: Parse Full Name into First and Last Name attributes
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.
-
- Posts: 303
- Joined: Wed Apr 22, 2015 11:44 pm
Re: Parse Full Name into First and Last Name attributes
Jhstephenson wrote:That's interesting. This is what it says in Appendix B of the User Guide:ACDC wrote:I use this extensively in MySqlBut apparently they only work with Derby.
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.
![Very Happy :D](./images/smilies/icon_biggrin.gif)