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

Can we use ddl commands in pl sql?

0 Answers  


What is difference between table and view?

0 Answers  


What is the command used to fetch first 5 characters of the string?

0 Answers  


What are the two virtual tables available at the time of database trigger execution?

0 Answers  


What is compilation error in pl sql?

0 Answers  






Explain UNION,MINUS,UNION ALL, INTERSECT?

1 Answers  


Hello All, Could any well write a query for the following scenario. Account(table name) No Name Amount 1 ABCD 2000.00 2 DEFG -2000.00 3 GHIJ 3000.50 4 JKLM 4000.00 5 MNOP 6000.00 O/p Should be in this format No Name Credit Debit 1 ABCD 2000.00 0 2 DEFG 0 -2000.00 3 GHIJ 3000.50 4 JKLM 0 -4000.00 5 MNOP 6000.00 o could any one give appropriate query for this Thnks in Advance Suneel Reddy

6 Answers   Target,


what is normalization? : Sql dba

0 Answers  


Is sqlite thread safe?

0 Answers  


What is java sql package?

0 Answers  


how to use myisamchk to check or repair myisam tables? : Sql dba

0 Answers  


How does one use sql*loader to load images, sound clips and documents? : aql loader

0 Answers  


Categories