Search code examples
sap-ase

String functions in Sybase ASE


I want to retrieve "name" from "My_name_is_ABC", how to do it in Sybase-ASE ?

I tried finding on internet but inbuild functions i saw are not supported in ase.

Atleast i need to know how to do find index of a string.


Solution

  • Sybase ASE does have inbuilt string functions as Documented Here. You can use SUBSTRING and CHARINDEX function to get your desired result like below

    select substring("My_name_is_ABC",charindex("_", "My_name_is_ABC")+1,4)
    

    Syntax for Substring function : substring(expression, start, length )