Practice 1: Changes to data will only be allowed on tables
during normal office hours of 8.45 in the morning until
5.30 in the afternoon, MONDAY through FRIDAY.

A. Create a procedure called SECURE_DML that prevents the
DML statement from executing outside of normal office
hours, returning the message:
“you may only make changes during normal office hours”

b. Create a statement trigger on the PRODUCT table which
calls the above procedure.

c. Test it by inserting a new record in the PRODUCT table.



Practice 1: Changes to data will only be allowed on tables during normal office hours of 8.45 in t..

Answer / narenkumar reddy

create or replace
procedure SECURE_DML
is

begin
if to_char(sysdate,'h24:mi') not between '08:30' and '17:30' and
to_char(sysdate,'day') not between 'MONDAY' and 'FRIDAY' then
raise_application_error(-20001,'you may only make changes during normal
office hours');
end if;
end;

create or replace
trigger trigger_name
before insert or update or delete on PRODUCT
begin
SECURE_DML( );
end;

Is This Answer Correct ?    22 Yes 3 No

Post New Answer

More SQL PLSQL Interview Questions

What's the difference between a primary key and a clustered index?

0 Answers  


Mention what does plv msg allows you to do?

0 Answers  


Name Salary Abc 50000 Abc 50000 xyz 20000 find the max salary using aggregate function?

2 Answers   CTS,


Explain some predefined exceptions.

0 Answers  


There is a sequence with min value 100. I want to alter this sequence to min value as 101. If the table has already data in the sequence column as 100,101,102... Is it possible to do so ?

4 Answers   IBM,






What is difference between TRUNCATE & DELETE?

16 Answers   Ahn Infotech, CitiGroup, ICICI, PreVator, Saama Tech, SkyTech, TCS,


What is a record in pl/sql?

0 Answers  


What is difference between sql and oracle?

0 Answers  


how i do the database testing of online money transactions between two parties (client and organization). suppose our company makes a website for our client and give a extra feature of online money transaction with there clients then how i test this feature in database testing

1 Answers  


What is sql profiler in oracle?

0 Answers  


how to use in conditions? : Sql dba

0 Answers  


explain normalization concept? : Sql dba

0 Answers  


Categories