Bemærk denne del i din kode:
WHILE cursor1%NOTFOUND
Din loop vil aldrig blive udført for ikke-tomt datasæt. Brug dette i stedet:
WHILE cursor1%FOUND
Eller endnu bedre brug implicit markør:
FOR cursor1 in
(SELECT rec,
d_id,
customer,
wife,
date_rec,
special_h,
g_amount,
credit_amount,
a_number,
a__name
FROM (your query here))
LOOP
v_clob :=
v_clob
|| cursor1.rec
|| ','
|| cursor1.d_id
|| ','
|| cursor1.customer
|| ','
|| cursor1.wife
|| ','
|| cursor1.date_rec
|| ','
|| cursor1.special_h
|| ','
|| cursor1.g_amount
|| ','
|| cursor1.credit_amount
|| ','
|| cursor1.a_number
|| ','
|| cursor1.a__name
|| UTL_TCP.crlf;
END LOOP;