我正在嘗試使用SQL Developer綁定變量提示來加快查詢執行速度,但我沒有得到所需的輸出:看起來像我放入的值得到轉換。SQL Developer綁定變量提示符:強制字符串值
表描述:
Nome Null Type
------------------ -------- ------------
NUM NOT NULL VARCHAR2(13)
IS_OK NUMBER(1)
初始情況:
select NUM, IS_OK from numbers_table where NUM = cast(:dn as varchar2(13));
NUM |IS_OK |
------------|------|
08331930078 |1 |
工作更新:
1.
update numbers_table set IS_OK = 0 where NUM = 08331930078;
2.
update numbers_table set IS_OK = 0 where NUM = '08331930078';
輸出繼電器:
'1 row updated'
非工作更新:
update numbers_table set IS_OK = 0 where NUM = cast(:dn as varchar2(13));
輸出繼電器:
'0 rows updated'
不知道我還能做些什麼來強制將值解析爲字符串。
SQL Developer版本4.1.3.20
沒有必要投入任何東西,您的查詢應該是:update numbers_table set IS_OK = 0其中NUM =:dn; –
事實證明,它不會像那樣工作(這正是我最初設想的) – Dariopnc