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 |
explain the difference between bool, tinyint and bit. : Sql dba
how can you see all indexes defined for a table? : Sql dba
What is embedded sql with example?
what is the difference difference between procedure and packages
2 Answers 3i Infotech, Oracle,
What is procedure in pl sql?
what is 'mysqlshow'? : Sql dba
what is self join and why is it required? : Sql dba
Who is the owner of mysql database?
What is the difference between numeric and autonumber?
what tools available for managing mysql server? : Sql dba
What is execute immediate?
How do I edit a trigger in sql developer?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)