dec ld_value
code= "1"
ls_sql= "select sum(a.value) from ttt a"
DECLARE c1 DYNAMIC CURSOR FOR SQLSA;
PREPARE SQLSA FROM :ls_sql;
OPEN DYNAMIC c1 USING :code;
FETCH c1 INTO :ld_value;
If SQLCA.SQLCode=0 then //如果成功取出记录
messagebox('',string(ld_value))
end if
CLOSE c1;
怎么执行后没有返回值,请大家帮忙看看!!!
5 个解决方案
#1
怎么发重复贴?
你先检查
select sum(a.value) from ttt a 有没有结果集.
你先检查
select sum(a.value) from ttt a 有没有结果集.
#2
有结果集
#3
string ls_sql
dec ld_value
ls_sql= "select sum(a.value) from ttt a"
DECLARE c1 DYNAMIC CURSOR FOR SQLSA;
PREPARE SQLSA FROM :ls_sql;
FETCH c1 INTO :ld_value;
If SQLCA.SQLCode=0 then //如果成功取出记录
messagebox('',string(ld_value))
end if
CLOSE c1;
#4
将表base中的code字段中间两位为”01”的所有记录读取出来并分别进行相应处理。
STRING lsSQL,lsCode,lsName,lsFilter
LsFilter=”01”
LsSQL=”SELECT code,name FROM base WHERE substring(code,3,2)=?”
DECLARE cursor_base DYNAMIC CURSOR FOR SQLSA;
PREPARE SQLSA FROM:lsSQL;
OPEN DYNAMIC cursor_base USING:lsFilter;
FETCH cursor_base INTO:lsCode,:lsName;
DO WHILE SQLCA.SQLCODE=0
. ∥对满足条件的记录根据要求分别进行处理
. FETCH cursor_base INTO:lsCode,:lsName;
LOOP
CLOSE cursor_base;
#5
已解决 谢谢各位
#1
怎么发重复贴?
你先检查
select sum(a.value) from ttt a 有没有结果集.
你先检查
select sum(a.value) from ttt a 有没有结果集.
#2
有结果集
#3
string ls_sql
dec ld_value
ls_sql= "select sum(a.value) from ttt a"
DECLARE c1 DYNAMIC CURSOR FOR SQLSA;
PREPARE SQLSA FROM :ls_sql;
FETCH c1 INTO :ld_value;
If SQLCA.SQLCode=0 then //如果成功取出记录
messagebox('',string(ld_value))
end if
CLOSE c1;
#4
将表base中的code字段中间两位为”01”的所有记录读取出来并分别进行相应处理。
STRING lsSQL,lsCode,lsName,lsFilter
LsFilter=”01”
LsSQL=”SELECT code,name FROM base WHERE substring(code,3,2)=?”
DECLARE cursor_base DYNAMIC CURSOR FOR SQLSA;
PREPARE SQLSA FROM:lsSQL;
OPEN DYNAMIC cursor_base USING:lsFilter;
FETCH cursor_base INTO:lsCode,:lsName;
DO WHILE SQLCA.SQLCODE=0
. ∥对满足条件的记录根据要求分别进行处理
. FETCH cursor_base INTO:lsCode,:lsName;
LOOP
CLOSE cursor_base;
#5
已解决 谢谢各位