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

How do I save the results of sql query in a file?

541


Can you sum a count in sql?

567


What is column?

556


What is the use of <> sql?

558


how to increment dates by 1 in mysql? : Sql dba

545






What are the properties of a transaction?

575


Can we insert data into view?

529


Are stored procedures compiled?

527


What version is sql?

556


What is the process of copying data from table a to table b?

602


Can you selectively load only those records that you need? : aql loader

615


How can you select unique records from a table?

524


Inline the values in PL/SQL, what does it mean.?

635


What are the types of operators available in sql?

555


What is the difference between a procedure and a function?

500