cancel
Showing results for 
Search instead for 
Did you mean: 

Update certain position number of column value using SQLScript in HANA

former_member435389
Participant
0 Kudos

Hi experts,

For example ,

YEAR MON

2022 11100111

I want to update the third "1" to "0" of MON, the result is :

YEAR MON

2022 11000111

And the position maybe a variable , ie, not the third one, but the fourth.

CharlesFeng
Advisor
Advisor
0 Kudos

I try to find if there is a direct STRING function to achieve it, however, I couldn't find one.
Here is a workaround I could propose, just for your reference.
substring ("whole string", 1, 2 or 3) + "0" + substring ("whole string", 4 or 5, <rest length>)
See more details about SUBSTRING in https://help.sap.com/docs/SAP_HANA_PLATFORM/4fe29514fd584807ac9f2a04f6754767/20e8341275191014a4cfdcd...

Accepted Solutions (0)

Answers (0)