Term Fly Presents http://www.flyheart.com
pl (book_rec.isbn || ' - ' ||
You need not take out "programmer's insurance": "Gee, I don't know if I need to declare that or not, so I'd better declare it." Instead, you make certain you understand how PL/SQL works and write appropriate code.
CTL-08: Scan collections using FIRST, LAST, and NEXT in loops.
CREATE OR REPLACE PACKAGE mycollection
TYPE string_tt IS TABLE OF VARCHAR2 (2000) INDEX BY BINARY_INTEGER;
PROCEDURE show (list_in IN string_tt);
FUNCTION eq (list1_in IN string_tt, list2_in IN string_tt) RETURN BOOLEAN
retval BOOLEAN := TRUE;
indx PLS_INTEGER := list1_in.FIRST;
l_last1 PLS_INTEGER := list1_in.LAST;
AND indx <= l_last1
retval := list1_in (indx) = list2_in (indx);
indx := indx + 1;
At first glance, this seems fine. I throw together a test and am pleased with the results, as shown here: