pb里的动态游标(字符串作为sql)

ls_sql=" select isnull(sum(sale_q),0),isnull(sum(tax_sale_a),0) "
  ls_sql+="from article_sale_da a,article b "
  ls_sql+="where a.aid=b.aid and segregate_id in "+ls_fw+" and dt>='"+ls_dt3+"' and dt<='"+ls_dt2+"'"
  ls_sql+=" group by dt "
  ls_sql+=" order by dt "
  declare cur_seg  dynamic cursor for SQLSA;
  prepare SQLSA from :ls_sql;
  open DYNAMIC cur_seg;
  fetch cur_seg into :ldc_q,:ldc_a;
  do while sqlca.sqlcode=0
   messagebox(string(ldc_q),string(ld_qgs))
   of_setxyvalue(li_y,li_ap + k * 7,ldc_a * ld_ags)//6"单点
   of_setxyvalue(li_y,li_qp + k * 7,ldc_q * ld_qgs)//6"单点
   k+=1
   fetch cur_seg into :ldc_q,:ldc_a;
  loop
  close cur_seg;
posted @ 2008-08-05 18:54  kuailewangzi1212  阅读(1054)  评论(0编辑  收藏  举报