How to escape single quotes in Sybase

后端 未结 2 2231
花落未央
花落未央 2021-02-19 05:49

I come from MySQL and the below query doesn\'t work in Sybase. How should I escape single quotes?

UPDATE Animals SET NAME = \'Dog\\\'s friends\' WHERE uid = 12
<         


        
2条回答
  •  遥遥无期
    2021-02-19 06:41

    You can create a custom function to escape quotes :

    CREATE FUNCTION "ESCAPE_QUOTES"(in a_string long varchar) 
    returns long varchar
    begin
      return replace(a_string, '''', '''''');
    end
    

提交回复
热议问题