Pragma WNPS and RNPS restrict references in oracle

Опубликовано: 04 Январь 2022
на канале: InventiateBlogs
266
7

Code:
Here is the basic implementation of the pragma restrict references. If want one more video for rnds,wnds. Like and Comment. Regards.
Pragma WNPS
WNPS Stands for Write No Package State
We first create a package with following contents as shown below. We did have score variable and a procedure 'read_score'. The motive is to create a mechanism accordingly give compilation error whenever a person tries to modify any variable inside the 'read_score' procedure in Package body.

Pragma RNPS
RNPS Stands for Read No Package State
We first create a package with following contents as shown below. We did have score variable already assigned with value and a procedure 'update_score'. The motive is to create a mechanism accordingly give compilation error whenever a person tries to read any variable inside the 'update_score' procedure in Package body.

Check out Code at Blog
https://btechcse762.blogspot.com/2021...

Pragma 1 wnps
create or replace package wnps_pk
as
score number(10);
procedure read_score;
pragma restrict_references(read_score,wnps);
end;

create or replace package body wnps_pk
as
procedure read_score is
begin
score:=14;
end read_score;
end;

Pragma 2 RNPS
create or replace package rnps_pk
as
score number(10):=50;
procedure update_score;
pragma restrict_references(update_score,rnps);
end;

create or replace package body rnps_pk
as
procedure update_score is
begin
score:=13;
dbms_output.put_line(score);
end update_score;
end;

Operating System: Windows 11


Смотрите видео Pragma WNPS and RNPS restrict references in oracle онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь InventiateBlogs 04 Январь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 266 раз и оно понравилось 7 людям.