How Invalid Subscripts are Handled With DELETE(n)
DECLARE
TYPE NUMLIST IS TABLE OF NUMBER;
NUMS NUMLIST := NUMLIST(10,20,30); -- initialize table
BEGIN
NUMS.DELETE(-1); -- does not raise SUBSCRIPT_OUTSIDE_LIMIT
NUMS.DELETE(3); -- delete 3rd element
DBMS_OUTPUT.PUT_LINE(NUMS.COUNT); -- prints 2
NUMS(3) := 30; -- allowed; does not raise NO_DATA_FOUND
DBMS_OUTPUT.PUT_LINE(NUMS.COUNT); -- prints 3
END;
/
0 comments:
Post a Comment