Oracle PL/SQL : remove “space characters” from a string

后端 未结 6 1832
迷失自我
迷失自我 2021-02-02 10:48

In my Oracle 10g database I would like to remove \"space characters\" (spaces, tabs, carriage returns...) from the values of a table field.

Is TRANSLATE() t

6条回答
  •  伪装坚强ぢ
    2021-02-02 11:49

    Shorter version of:

    REGEXP_REPLACE( my_value, '[[:space:]]', '' )
    

    Would be:

    REGEXP_REPLACE( my_value, '\s')
    

    Neither of the above statements will remove "null" characters.

    To remove "nulls" encase the statement with a replace

    Like so:

    REPLACE(REGEXP_REPLACE( my_value, '\s'), CHR(0))
    

提交回复
热议问题