TAILIEUCHUNG - Oracle PL/SQL by Example- P9

Tham khảo tài liệu 'oracle pl/sql by example- p9', 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 372 Lab Exercises Consider partial output from the preceding example Zip 06820 Names 1 Scrittorale Names 2 Padel Names 3 Kiraly Zip 06830 Names 1 Dennis Names 2 Meshaj Names 3 Dalvi Zip 06880 Names 1 Miller Names 2 Cheevens Zip 06903 Names 1 Segall Names 2 Annina Zip 07003 Names 1 Wicelinski Names 2 Intal Zip 07010 Names 1 Lopez Names 2 Mulroy Names 3 Velasco Names 4 Kelly Names 5 Tucker Names 6 Mithane PL SQL procedure successfully completed. Please purchase PDF Split-Merge on to remove this watermark. LAB 373 LAB Collections of Records LAB OBJECTIVE After completing this lab you will be able to Use collections of records In the previous lab you saw an example of a nested record in which one of the record fields was defined as an associative array. PL SQL also lets you define a collection of records such as an associative array whose element type is a cursor-based record as shown in the following example . FOR EXAMPLE DECLARE CURSOR name_cur IS SELECT first_name last_name FROM student WHERE ROWNUM 4 TYPE name_type IS TABLE OF name_cur ROWTYPE INDEX BY BINARY_INTEGER name_tab name_type v_counter INTEGER 0 BEGIN FOR name_rec IN name_cur LOOP v_counter v_counter 1 name_tab v_counter .first_name name_tab v_counter .last_name First Name v_counter name_tab v_counter .first_name Last Name v_counter name_tab v_counter .last_name END LOOP END Please purchase PDF Split-Merge on to remove this watermark. LAB Lab Exercises 374 In the declaration portion of this example you define the name_cur cursor which returns the first and last names of the first four students. Next you define an associative array type whose element type is based on the cursor defined previously using the ROWTYPE attribute. Then you define an associative array variable and the counter that is used later to reference individual rows of the associative array. In

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.