Tham khảo tài liệu 'oracle pl/sql by example- p8', công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | LAB PL SQL Tables 322 DID YOU KNOW What is the difference between a NULL collection and an empty collection If a collection has not been initialized referencing its individual elements causes the following error DECLARE TYPE integer_type IS TABLE OF INTEGER integer_tab integer_type v_counter integer 1 BEGIN integer_tab v_counter END DECLARE ERROR at line 1 ORA-06531 Reference to uninitialized collection ORA-06512 at line 7 If a collection has been initialized so that it is empty referencing its individual elements causes a different error DECLARE TYPE integer_type IS TABLE OF INTEGER integer_tab integer_type integer_type v_counter integer 1 BEGIN integer_tab v_counter END DECLARE ERROR at line 1 ORA-06533 Subscript beyond count ORA-06512 at line 7 COLLECTION METHODS In the previous examples you have seen one of the collection methods EXTEND. A collection method is a built-in function that is called using dot notation as follows The following list explains collection methods that allow you to manipulate or gain information about a particular collection EXISTS returns TRUE if a specified element exists in a collection. This method can be used to avoid SUBSCRIPT_OUTSIDE_LIMIT exceptions. COUNT returns the total number of elements in a collection. Please purchase PDF Split-Merge on to remove this watermark. PL SQL Tables LAB 323 EXTEND increases the size of a collection. DELETE deletes either all elements elements in the specified range or a particular element from a collection. Note that PL SQL keeps placeholders of the deleted elements. FIRST and LAST return subscripts of the first and last elements of a collection. Note that if the first elements of a nested table are deleted the FIRST method returns a value greater than 1. If elements have been deleted from the middle of a nested table the LAST method returns a value greater than the COUNT method. PRIOR and NEXT return .