sql = "select p_partno from p_partno_rm group by p_partno order by p_partno"
declare my3 dynamic cursor for sqlsa;
prepare sqlsa from :sql;
open dynamic my3;
fetch my3 into:partno;
do while sqlca.sqlcode = 0
partno = trim(partno)
if partno <> "" and not isnull(partno) then
ddlb_partno.additem(partno)
end if
fetch my3 into:partno;
loop
close my3;
if sqlca.sqlcode = 0 then
commit using sqlca;
else
rollback using sqlca;