Live ORACLE

if you are Oracle Developer ,than this Blog most likely will make you happy.

About my Blog

This Blog particularized for Oracle Developers ... you will see interesting Codes for SQL , PL/SQL as well as new ideas for Developer Suite and Client Tools that will help you in your professional life ... and I hope I reach for your satisfaction.

About Me

I'm Hany Freedom , 25 years old , I live in EL-Minia City in Egypt , I'm Moderator at ArabOUG.org the best Arabic Forum for ORACLE on the Net. if you interested to know more about me .... just Click Here.

Using NOCOPY With Parameters

DECLARE
TYPE emptabtyp IS TABLE OF employees%ROWTYPE;
emp_tab EMPTABTYP := Emptabtyp(NULL); -- initialize
t1 NUMBER;
t2 NUMBER;
t3 NUMBER;
PROCEDURE Get_time
(t OUT NUMBER)
IS
BEGIN
t := dbms_utility.get_time;
END;
PROCEDURE Do_nothing1
(tab IN OUT EMPTABTYP)
IS
BEGIN
NULL;
END;
PROCEDURE Do_nothing2
(tab IN OUT NOCOPY EMPTABTYP)
IS
BEGIN
NULL;
END;
BEGIN
SELECT *
INTO Emp_tab(1)
FROM employees
WHERE employee_id = 100;
emp_tab.Extend(49999,1); -- copy element 1 into 2..50000
Get_time(t1);
Do_nothing1(emp_tab); -- pass IN OUT parameter
Get_time(t2);
Do_nothing2(emp_tab); -- pass IN OUT NOCOPY parameter
Get_time(t3);
dbms_output.Put_line('Call Duration (secs)');
dbms_output.Put_line('--------------------');
dbms_output.Put_line('Just IN OUT: '
||To_char((t2
- t1)
/ 100.0));
dbms_output.Put_line('With NOCOPY: '
||To_char((t3
- t2))
/ 100.0);
END;
/



OUTPUT:-

Call Duration (secs)
--------------------
Just IN OUT: .16
With NOCOPY: 0

PL/SQL procedure successfully completed.

Share/Save/Bookmark

0 comments:

Post a Comment



Newer Posts Older Posts Home Page
 
http://www.dpriver.com/images/sqlpp-banner-2.png

Thanks for reading my Blog ... you Visitor Number :-