简体   繁体   English

SAP HANA中initcap的常规表达

[英]REGULAR EXPRESSION for initcap in sap hana

We are using SAP HANA 1.0 SPS 12. AS SAP HANA does not have INTICAP function like oracle, I am trying to realize the same through REGEXP_REPLACE. 我们正在使用SAP HANA 1.0 SPS12。由于SAP HANA没有像oracle这样的INTICAP功能,我试图通过REGEXP_REPLACE来实现。

Basically I want first letter of each string as UPPER CASE. 基本上,我希望每个字符串的首字母都为大写。

In oracle it is possible as - 在oracle中,可能是-

select initcap('abc') from dual ---- Output -'Abc'

In SAP HANA I am trying - 在SAP HANA中,我正在尝试-

SELECT REPLACE_REGEXPR('([[:alnum:]]{1})([[:alnum:]])' IN 'abc' WITH 'upper(\1)\2') "replace_regexpr" FROM DUMMY;

But this is not working? 但这行不通吗? Is it possible to realize this with REGEXP_REPLACE? 是否可以使用REGEXP_REPLACE来实现?

Select CONCAT(upper(substring(col1,1,1)),substring(col1,2,length(col1)-1)) from 
yourTable 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM