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

how to delete duplicate rows from a specified table(only single table) how do you know which join is need to be used

11 Answers   UST,


What is difference between cursor and trigger?

0 Answers  


What is an alias command?

0 Answers  


Differentiate between pl/sql and sql?

0 Answers  


Are null values same as that of zero or a blank space?

0 Answers  






How can I create a table from another table without copying any values from the old table?

8 Answers  


What is number function in sql?

0 Answers  


What is coalesce sql?

0 Answers  


What are nested triggers ?

6 Answers   Amazon, Appeal Soft, IBM, Infosys, TCS,


what is the difference between sql and t-sql? : Transact sql

0 Answers  


Which join condition can be specified using on clause?

0 Answers  


If there are 1 to 100 numbers in a table and in that 100 numbers some 10 numbers are deleted.I want to find out the missing numbers between 1 to 100 by pl/sql how?

9 Answers   JPMorgan Chase,


Categories