What is PL/SQL tables?
What is PL/SQL tables. When and why they are used. PL/Sql table is a virtual array(single array) table defined during runtime.These tables help u in storing,manipulating in a blocks thus removing the need to connect to the database for information except for the first time and later can be updated into the database. eg
emp
Now I would like to give the employees an increment/commission and will create a procedure with some logic. Create procedure empinc
for i in v_empsal.first..v_empsal.last
begin
end; In the above example as you see
I didn't need to use any extra valrables nor define any data types. Both
of these were as it was defined in the database and the array takes care
of storing the values and insertion of the details in to the table was
done by
Kiran Patil Anyway you are using the cursor variable, so you can loop across the records and process one by one. The use of table type variable is not significant. When you open the cursor, during first fetch use bulk collect and take the records into table variables declared. After this close the cursot. YOU NEED NOT LOOP across the cursor. Table type variable is very useful when you need to select in the array. Declare
for v_empno in empno_list_var.first ..
end; Amit
Have a Oracle Question
Oracle Books
Oracle Application
Oracle Home
All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|