如何在PB里写sql语句加数组条件
定义了一string型数据ls_inncd[]
这样写sql语句没通过
delete from table where inncd in (:ls_inncd[])
应该如何写?
[解决办法]
用动态SQL:
string ls_inncd
String ls_sql
long ll_kk
For ll_kk= 1 To dw_shop.rowcount()
ls_inncd += "'"+dw_shop.getitemstring(ll_kk,'inncd')+"',"
Next
ls_inncd = Left(ls_inncd,len(ls_inncd) - 1)
ls_sql = "delete from sup_fee where sup_code= '"+billcode+"' and inncd in ("+ls_inncd+")"
Execute Immediate :ls_sql;
[解决办法]