我试图在SQL查询中使用变量但是失败了。怎么做到这一点?
var SicilNumvber = SessionCurrentUser.EMPNO;
string query = "select * from crm_visible_v where ownerid in (select sicilno from personel.pkim_kutlama@netdb_1.europe.nortel.com where cikis_tarihi is null start with sicilno = :SicilNumvber connect by prior sicilno = amir)";
此致
答案 0 :(得分:0)
请将固定字符串与变量部分连接起来,如下所示
string query := 'select * from crm_visible_v where ownerid in (select sicilno
from personel.pkim_kutlama@netdb_1.europe.nortel.com where cikis_tarihi is null
start with sicilno ='||SicilNumvber||' connect by prior sicilno = ''''amir'';
答案 1 :(得分:0)
成功查询如下: 谢谢你的帮助;
string query = "select * from crm_visible_v where ownerid in (select sicilno from personel.pkim_kutlama@netdb_1.europe.nortel.com where cikis_tarihi is null start with sicilno ='"+SicilNumvber+"' connect by prior sicilno = amir)";