首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

store procedure 中 in 加變數,怎麼寫?该如何解决

2012-06-05 
store procedure 中 in 加變數,怎麼寫?各位先進:程式傳入一個變數:A1A1 1,2,3,4然後在store p

store procedure 中 in 加變數,怎麼寫?
各位先進:
程式傳入一個變數:A1
A1 = "'1','2','3','4'"

然後在store procedure寫
select a,b,c
from ta
where c in (A1);

這樣的語法錯誤嗎?會找不到資料,如果將他改成
select a,b,c
from ta
where c in ('1','2','3','4');
就找得到資料
有誰知到原因嗎?

[解决办法]

探讨

請問forgetsam,
那有沒有比較不蠢的方法,
讓c='1' or c= '2' or c='3' or c='4'時,都能滿足條件啊!

热点排行