剛剛在toad執行了一個SQL

insert into test (A1,A2,A3) values('11','22','http:\\1.1.1.1\do?aa=2&para=333');

出現了一個視窗,很麻煩。

原因就是&在toad sql中是擔任著替代變數(substitution variable)的功能,碰到&就表示可以輸入替代的值。

image

 

如何讓這個替代變數功能暫時消失呢 ?

 

有兩個方法:

1.把SQL內&區隔,例:'http:\\1.1.1.1\do?aa=2&' || 'para=333';

2.在SQL最前端加set define off,
   這個指令就是關閉替代變數功能,
   當然開啟就是set define on。

 

參考網址:

http://blog.andrewbeacock.com/2008/09/using-ampersands-without-variable_15.html

http://jerryllx.iteye.com/blog/546637

arrow
arrow

    味味A 發表在 痞客邦 留言(0) 人氣()