First page Back Continue Last page Graphics
PL/SQL Bind Variables
PL/SQL variables are bind variables:
Notes:
PL/SQL variables used within an SQL statement are in fact bind variables. We can measure the performance improvement by running the same program without bind variables:
SQL> declare
2 l_start number := dbms_utility.get_time;
3 begin
4 for i in 1..10000 loop
5 insert into t
6 values(dbms_random.random, dbms_random.random);
7 end loop;
8 commit;
9 dbms_output.put_line(
10 round( (dbms_utility.get_time - l_start) / 100
11 ,2) || ' seconds');
12 end;
13 /
3.59 seconds
PL/SQL procedure successfully completed.
We see a dramatic reduction (45%) in run time!