Question about PRIOR and NEXT methods used with Nested Tables.(from a book)
Hello, I am reading a book on PL/SQL, that has the following script,
and I don't understand the methods PRIOR and NEXT use with Nested Tables.
Please read my comments.
DECLARE
TYPE nested_type IS TABLE OF NUMBER;
nested_table nested_type := nested_type(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
BEGIN
-- delete 10th element from a collection
nested_table.DELETE(10);
DBMS_OUTPUT.PUT_LINE ('nested_table.LAST = '||nested_table.LAST); -- ok
-- delete elements 1 through 3 from a collection
nested_table.DELETE(1,3);
-- so this deletes numbers 1,2,3
-- so, my netsed table now is -- 4,5,6,7,8,9
DBMS_OUTPUT.PUT_LINE ('nested_table.FIRST ='||nested_table.FIRST); -- that is 4 ok
DBMS_OUTPUT.PUT_LINE ('nested_table.LAST = '||nested_table.LAST); -- that is 9 ok
--
DBMS_OUTPUT.PUT_LINE ('nested_table.PRIOR(2) = '||nested_table. PRIOR(2)); -- this gives me null
DBMS_OUTPUT.PUT_LINE ('nested_table.NEXT(2) = '||nested_table.NEXT(2)); -- this gives me 4
-- I don't understand why nested_table.PRIOR(2) gives null instead of 4, because the second element of the table is 5, so prior to this (before) is 4.
-- Also I don't understand why nested_table.NEXT(2) gives 4 instead of 6, because the second element of the table is 5 and the next element is 6.
END;
Thank you very much.
Also an advice (if possible), because I am out of work (unemployed) for a year, will PL/SQL give me a job?
Because all I see is Java in job advertisements, and not PL/SQL ( for Greece )
What is good for a PL/SQL Developer to know also to find a job?