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.

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the current version of sql?

531


What is the location of pre_defined_functions.

641


Why is pl sql needed?

503


Does normalization improve performance?

552


Which sorts rows in sql?

579






What does := mean in pl sql?

551


What will you get by the cursor attribute sql%notfound?

585


What is t sql in sql server?

564


what is union, minus and interact commands? : Sql dba

653


Why do we create views in sql?

548


what is log shipping? : Sql dba

603


How to connect a sql*plus session to an oracle server?

617


What is an exception in pl/sql?

540


hi,i plan to put experience on PLSQL ,can anyone suggest me for any institutes in bangalore or how to prepare for interviews

1521


Can we write dml inside a function in sql server?

494