PowerBuilder游标的使用

string ls_cop,ls_cops

declare cop_cursor cursor for
select cop_id from sys_cop where operations_center is not null and operations_center<>"" and operations_center=:ai_center using sqlca;

open cop_cursor;
 fetch cop_cursor into :ls_cop;
do while sqlca.sqlcode=0  
  ls_cops=ls_cops+","+ls_cop
      fetch cop_cursor into :ls_cop;
loop
close cop_cursor;
ls_cops=mid(ls_cops,2)
messagebox("ls_cops",ls_cops)

你可能感兴趣的:(PowerBuilder)