Any suggestions to avoid the error will be greatly appreciated. This is the last piece on my verification code for testing. It's heavily customized but basically I'm checking for primary keys that are related to each other. For example: Table A (key1, key2) and Table B(key3, key 4). The sought after condition is where Table B(key 4) = Table A (key 2) while Table A(key1) = Table B(key3) by row. (Hope that wasn't too confusing)sub Backwards { my $db =shift; my $database =shift; #-- Returns any EDIT_RELD_EDIT_IDs and OIDs that point back to the +mselves my $sth_all = $db->prepare_cached(" SELECT OID, EDIT_RELD_EDIT_ID FROM AG_EDIT_RELD_ED +IT ") or print STDOUT "Query: Check +ing For Backwards Links Failed"; $sth_all->execute(); my $all_rows = $sth_all->fetchall_arrayref; $sth_all->finish; undef $sth_all; print "******Backwards Links******\n\n" if ($#$all_rows > -1); for $all_rows_r (@{$all_rows}) { #print "SELECT OID, EDIT_ID FROM AG_EDITORIAL WHERE OID = $all +_rows_r->[0] AND EDIT_ID = '$all_rows_r->[1]'\n"; #print "Next\n"; my $sth_back = $db->prepare_cached(" SELECT OID, EDIT_ID FROM AG_EDITORIAL WHERE OI +D = $all_rows_r->[0] AND EDIT_ID = '$all_rows_r->[1]' AND OID NOT IN (SELECT OID FROM AG_EDIT_RELD_E +DIT WHERE OID NOT IN (SELECT OID FROM AG_EDITORIAL) ) ") or print STDOUT "Query: C +hecking For Backwards - Part 2 Links Failed at OID: $all_rows_r->[0] +and EDIT_ID: $all_rows_r->[1]"; $sth_back->execute(); my $back_links = $sth_back->fetchall_arrayref; $sth_back->finish; undef $sth_back; for $back_links_r (@{$back_links}) { push (@{$Backward_Links_2{OID}}, $back_links_r->[0]); push (@{$Backward_Links_2{EDIT_ID}}, $back_links_r->[1]); print &Pad_Text_Left("The following EDIT_RELD_EDIT_ID does + not exist in AG_Editorial:OID => $back_links_r->[0] EDIT_ID => $ba +ck_links_r->[1]\n\n", 80); } } }
In reply to Oracle Cursors Exceeded by timo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |