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 / 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 |
What's the difference between a primary key and a clustered index?
Mention what does plv msg allows you to do?
Name Salary Abc 50000 Abc 50000 xyz 20000 find the max salary using aggregate function?
Explain some predefined exceptions.
There is a sequence with min value 100. I want to alter this sequence to min value as 101. If the table has already data in the sequence column as 100,101,102... Is it possible to do so ?
What is difference between TRUNCATE & DELETE?
16 Answers Ahn Infotech, CitiGroup, ICICI, PreVator, Saama Tech, SkyTech, TCS,
What is a record in pl/sql?
What is difference between sql and oracle?
how i do the database testing of online money transactions between two parties (client and organization). suppose our company makes a website for our client and give a extra feature of online money transaction with there clients then how i test this feature in database testing
What is sql profiler in oracle?
how to use in conditions? : Sql dba
explain normalization concept? : Sql dba