一个PB的sql 语句问题,能者多助,谢过了(100')
我的pb程序代码是:
declare l_dbhistory Cursor for
select xh
from dbhistory where regno =:as_regno
using sqlca;
open l_dbhistory;
xhCursor:
Fetch l_dbhistory into :sheng_xh;
if sqlca.sqlcode = 0 then
xhstring+=string(sheng_xh)+","
goto xhCursor
end if
close l_dbhistory;//读取省数据库中的督办序号为了拼接shstring字符串
xhstring = " ("+xhstring+"0) "
declare c_dbhistory Cursor for
select regno,xh,recdept,dbdate,dbnr,dbdw,yfkdate
from dbhistory
where regno =:as_regno and xh not in :xhstring//问题!!!
using rmttrans;
open c_dbhistory;
startCursor:
Fetch c_dbhistory
into :ls_regno,:ld_xh,:ls_recdept,
:ldt_dbdate,:ls_dbnr,:ls_dbdw,:ldt_yfkdate;
.........
由上面拼接的字符串xhstring在下面的sql查询语句中无法识别,请问有无良策!!!
谢谢了!