Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

nocopy hint question in oracle

RanagalJun 25 2019 — edited Jun 26 2019

Hello experts,

DB Version:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

I have the following code:

set serveroutput on;

declare

    n number := 100;

    procedure p(n1 in number, n2 in out number, n3 in out nocopy number)

    is

    begin

        n2 := 200;

        dbms_output.put_line('1: '||n1);

        n3 := 300;

        dbms_output.put_line('2: '||n1);

    end;

begin

    p(n,n,n);

    dbms_output.put_line('3: '||n);

end;

/

And the output:

1: 100

2: 300

3: 200

What I don't understand is the last line of the output.

Why would it be 200 but not 300 ?

Regards,

Ranagal

This post has been answered by Cookiemonster76 on Jun 25 2019
Jump to Answer
Comments
Post Details
Added on Jun 25 2019
18 comments
2,833 views