wtite down triggr not any entry on Sunday

Answers were Sorted based on User's Feedback



wtite down triggr not any entry on Sunday..

Answer / debasish sinha

create or replace trigger trg_sun
before insert on <table name>
begin
if rtrim(to_char(sysdate,'day'))=rtrim('sunday') then
raise_application_error(-20345,'no transaction in sunday');
end if;
end trg_sun;

Is This Answer Correct ?    7 Yes 1 No

wtite down triggr not any entry on Sunday..

Answer / rajdeep

create or replace trigger <trigger_name> before insert on <table_name>
begin
if (sysdate,'day') in 'sunday'
then
raise_application_error(-20500,'cannot insert values on sunday');
end if;
end;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

What are all types of user defined functions?

0 Answers  


If i insert record in table A and these record should update in table B by using Trigger.How to achieve this.

4 Answers   Saama Tech, TCS,


How to call DDL statements from pl/sql?

5 Answers  


What are the advantages of normalization?

0 Answers  


What are the differences between in and exists clause?

0 Answers  






HOW TO PRINT * ** *** **** ***** BY USING SQL QUERY? (MAY BE USING SCRIPT)

8 Answers   BeBo Technologies,


Where the sql database files are stored?

0 Answers  


what is unique key constraint? : Sql dba

0 Answers  


In a table i have columns A,B,C and i have a composite index on columns A,B if so will the following query uses index or not? SELECT sal,name FROM <table_name> WHERE A=<value> AND B=<value> AND C=<value>;

2 Answers   Mastek,


What is data type in sql?

0 Answers  


How does join work in sql?

0 Answers  


What is the difference between a primary key and a unique key?

0 Answers  


Categories