pb动态sql语句

//增加判断临时表里下载的数据必须大于1条的条件否则不继续处理
li_temp_cnt = 0
declare cur_temp_cnt  dynamic cursor for SQLSA;
prepare SQLSA from :ls_sql3 using itrs_sqlca;
open DYNAMIC cur_temp_cnt;
fetch cur_temp_cnt into :li_temp_cnt;
//do while itrs_sqlca.sqlcode=0 
// fetch cur_temp_cnt into :li_temp_cnt; 
//loop
close cur_temp_cnt;

if li_temp_cnt = 0 then
 messagebox('提示','没有下载到数据!')
 return 0
end if

 

//例如

declare cur_temp_1  dynamic cursor for SQLSA;
   prepare SQLSA from :ls_sql using sqlca;
   open DYNAMIC cur_temp_1;
   fetch cur_temp_1 into :ldc_sale;   
   close cur_temp_1;

你可能感兴趣的:(sql语句)