2015年11月5日 星期四

[SQL]Inserting values into a table with '&'

如果要insert&符號時,用SQL Plus執行會停下來
可以用以下的方式insert &

create table test (name varchar2(10));
insert into test values ('&123');


 1.方式1,將define關掉
 set define off;
 insert into test values ('&123');


2.用ascii 取代(chr(38))
insert into test values (chr(38)||'123'); 

沒有留言:

張貼留言