0

我试图在 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)";

问候

4

2 回答 2

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'';
于 2013-07-30T07:41:00.590 回答
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)";    
于 2013-08-01T08:31:06.050 回答