powerbuilder 中select into 无法赋值 ,求高手帮忙看看,odbc连接的 10
treeviewitemtvilongl_tvistringls_bmmc,ls_tbmmcintli_bmid,li_count,li_tbmidlongnhdltv_...
treeviewitem tvi
long l_tvi
string ls_bmmc,ls_tbmmc
int li_bmid,li_count,li_tbmid
long nhdl
tv_1.getitem(handle,tvi);
ls_tbmmc=tvi.label
SELECT BMID into:li_tbmid from dbo.BAS_BMXX WHERE BMMC=:ls_tbmmc;
DECLARE cur CURSOR FOR
SELECT dbo.BAS_BMXX.BMID,
dbo.BAS_BMXX.BMMC
FROM dbo.BAS_BMXX
WHERE SJBMID=:li_tbmid;
OPEN CUR;
FETCH CUR INTO:li_bmid,:ls_bmmc;
DO WHILE SQLCA.SQLCODE=0
nhdl=tv_1.insertitemlast(handle,ls_bmmc,1)
//下面这行select into无法获取数据赋值到li_count
SELECT count(bas_bmxx.bmid)
INTO :li_count
FROM bas_bmxx
WHERE bas_bmxx.sjbmid = :li_bmid
;
tv_1.getitem(nhdl,tvi)
if li_count>0 then
tvi.children=true;
else
tvi.children=false;
end if
tv_1.setitem(nhdl,tvi)
FETCH CUR INTO:li_bmid,:ls_bmmc;
loop
close cur; 展开
long l_tvi
string ls_bmmc,ls_tbmmc
int li_bmid,li_count,li_tbmid
long nhdl
tv_1.getitem(handle,tvi);
ls_tbmmc=tvi.label
SELECT BMID into:li_tbmid from dbo.BAS_BMXX WHERE BMMC=:ls_tbmmc;
DECLARE cur CURSOR FOR
SELECT dbo.BAS_BMXX.BMID,
dbo.BAS_BMXX.BMMC
FROM dbo.BAS_BMXX
WHERE SJBMID=:li_tbmid;
OPEN CUR;
FETCH CUR INTO:li_bmid,:ls_bmmc;
DO WHILE SQLCA.SQLCODE=0
nhdl=tv_1.insertitemlast(handle,ls_bmmc,1)
//下面这行select into无法获取数据赋值到li_count
SELECT count(bas_bmxx.bmid)
INTO :li_count
FROM bas_bmxx
WHERE bas_bmxx.sjbmid = :li_bmid
;
tv_1.getitem(nhdl,tvi)
if li_count>0 then
tvi.children=true;
else
tvi.children=false;
end if
tv_1.setitem(nhdl,tvi)
FETCH CUR INTO:li_bmid,:ls_bmmc;
loop
close cur; 展开
2个回答
展开全部
SQLCA.SQLCODE是多少,有没有出错
另,INT类型的范围:-32768 to +32767,COUNT的结果会不会是越界了
另,INT类型的范围:-32768 to +32767,COUNT的结果会不会是越界了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
是不是int型不够大啊,越界了啊,改成long试一试
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询