Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: extracting records using a cursor within a cursor
swoop wrote:
> CURSOR tgbp_cur IS
>
> SELECT cmpy, supp, tran_entry_date, tran_sysref
> FROM tgbpaym
> WHERE v_cmpy <> v_py_cmpy
> AND v_supp <> v_py_supp
> AND v_entry_date <> v_py_tran_entry_date
> AND v_sysref <> v_py_tran_sysref;
This 2nd cursor of yours doesn't check that there is NO match in tgbpaym for those 4 values, it fins ALL the rows in tgbpaym that DO NOT match. So if tgbpaym has 10,000 rows and one of those rows matches, then the cursor will return the other 9,999 rows! Received on Wed May 25 2005 - 07:26:44 CDT