Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Finding last Index of a String in HANA

$
0
0

I am trying to do a address cleansing of a long text string loaded into HANA and I am trying to split the text based on the location of space " " in the string. As part of it I am trying to find the last index of a string in another string.

 

For Example for my stored staring of address:

2100 Pacific Ave, Atlantic City, NJ 08401

 

And I am need to find NJ and store it into another column where I can cleanse it further. So what I am trying to get is the location of last space and get 2 Chars  left of it. I know how to get it in Oracle and SQL server but I am unable to get around in HANA SQL or any BODS native functions.

 

In Oracle I used to make a sql something like this :

 

SELECT

substr(RAW_ADDR, instr (RAW_ADDR,' ',-1),2)

FROM "BODS"."TABLE"

 

And I can reverse it and get the same thing from SQL server. However reverse is a Reserved word in HANA but I can not make it work in HANA SQL. Any suggestion how to make it possible in HANA.

 

I am not getting a lot of reference doc for HANA or even SQL-92.

 

Here is the reference that I got (

http://help.sap.com/hana/html/sqlmain.html)

and it does not describe much. Any other good reference for HANA SQL which might help.


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>