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

Is not null in sql?

0 Answers  


Does sql*plus also have a pl/sql engine?

0 Answers  


State the difference between implict and explict cursor's?

7 Answers   CTS,


explain the options of myisamchk to improve the performance of a table. : Sql dba

0 Answers  


Does oracle use sql?

0 Answers  






How many triggers can be implemented for a table?

3 Answers   HSBC,


Can variables be used in sql statements?

0 Answers  


what is 'mysqld'? : Sql dba

0 Answers  


Can we join tables without foreign key?

0 Answers  


How many indexes can be created on a table in sql?

0 Answers  


what are numeric data types? : Sql dba

0 Answers  


display your age in months?

2 Answers  


Categories