2016-02-03 82 views

回答

2

像這種使用可替代報價運營商:test := q'[a','b','c]';

或者:

SELECT REPLACE(q'[a','b','c]', 'a','b') 
FROM DUAL; 

更多信息here

這裏的另一種方式來證明它在sqlplus:

SQL> declare 
    test varchar2(15) := q'[a','b','c]'; 
    begin 
    dbms_output.put_line(REPLACE(test, 'a', 'b')); 

    end; 
/

b','b','c 

PL/SQL procedure successfully completed. 

SQL> 
0

Escape與第二單引號每個單引號:

SELECT REPLACE('a'',''b'',''c','a','b') FROM DUAL