HomeНаука и техникаRelated VideosMore From: Tech Query Pond

Oracle tutorial : Collection in Oracle PL SQL - Varray

21 ratings | 1514 views
Oracle tutorial : Collection in Oracle PL SQL Varray . oracle tutorial for beginners 1)Varray provide feature of data structure in Oracle. 2)It can store a fixed-size sequential collection of elements of the same type. 3)This is used to store the ordered collection of data. 4)According to its structure the varray consist of contiguous memory locations. 5)The address is start from lowest to highest. 6)It start to store element from lowest address to highest address. 7)The starting index for varray is 1. 8)This is an one-dimensional array. Syntax : CREATE OR REPLACE TYPE varray_type_name IS VARRAY(n) of element_type DECLARE CURSOR cur_employee is SELECT NAME FROM employee; type emp_list is varray (10) of employee.name%type; empname_list emp_list := emp_list(); mycount integer :=0; BEGIN FOR i IN cur_employee LOOP mycount := mycount + 1; empname_list.extend; empname_list(mycount) := i.name; dbms_output.put_line('Employee Nane -'||empname_list(mycount)); END LOOP; END; / https://techquerypond.com , https://techquerypond.wordpress.com https://twitter.com/techquerypond
Html code for embedding videos on your blog
Text Comments (3)
siddhartha rao (2 years ago)
In real time where do we use Varrays?
siddhartha rao (2 years ago)
But i can use bulk collect in associative arrays also..Which is more efficient among Varrays and associative arrays?
Tech Query Pond (2 years ago)
Hi siddhartha rao , you can use varrays in pl/sql according to your requirments. You can use Varray in Bulk collect operation also in plsql.

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.