s_name1=dw_1.getitemstring(i,"s_come")
s_no1=""
ll_cnt=0
select the_no
into :s_no1
from sci_base_data
where the_class='IT03' and the_name=:s_name1;
select sum(s_female)
into :ll_cnt1
from sci_sci_person
where s_no IN
( select s_no
from sci_scis
where s_src2=:s_no1);
if isnull(ll_cnt1) then ll_cnt1=0
dw_1.setitem(i,"s_female",ll_cnt1)
在上面的程式段中,s_no1為string型別。為什么我在上面的程式中用到s_no1,不出結果。在嵌套的SQL陳述句里的where子句處,可不可以用變數。上面的程式錯在那兒
uj5u.com熱心網友回復:
在嵌套的SQL陳述句里的where子句處,可以用變數!你的代碼語法方面沒問題,試著在求:s_no1這個變數之后加一句if isnull(s_no1) then s_no1=""試試。
uj5u.com熱心網友回復:
是不是資料庫中沒有資料阿,你跟蹤一下,看看sqlca.sqlcode是什么uj5u.com熱心網友回復:
好的 謝謝各位 我試試uj5u.com熱心網友回復:
沒遇到過這種情況.uj5u.com熱心網友回復:
有問題請先GOOGLE,BAIDU轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/113646.html
標籤:數據庫相關
上一篇:sql200鎖
