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

How many triggers can be implemented for a table?

3 Answers   HSBC,


What is the difference between syntax error and runtime error?

0 Answers  


Talk about views

10 Answers   Polaris,


Can a foreign key be a duplicate?

0 Answers  


What is clustered and non-clustered indexes?

4 Answers   Microsoft,






I have a procedure in a procedure. The inner procedure contains out parameter. How I can call the inner procedure in the out procedure and send the inner procedure parameter value(out parameter value) into out procedure?

2 Answers  


explain mysql aggregate functions. : Sql dba

0 Answers  


How to recompile a already made trigger?

2 Answers  


what is the difference between implicit and explicit trigger

2 Answers   Tech Mahindra,


What are the various levels of constraints?

0 Answers  


which will default fire first  statement level trigger or row level trigger

2 Answers   Cap Gemini, Data Vision,


Is there a way to automate sql execution from the command-line, batch job or shell script?

0 Answers  


Categories