Question: SQL : I have created 3 tables ( table 1 , table 2 and view 3 ) in a database. I would like to

"SQL : I have created 3 tables (table 1, table 2 and view 3) in a database. I would like to create a trigger that shows the message ""none available"" and prevents insertion on on table 1 when view 3 is empty.
I have tried this:
create trigger none_available before insert on table_1 for each row if (not exis UJ20 ts ( select 1 from available)) begin print ""none available"" end;
but I get a syntax error at ""if""
I would like to know how to create this trigger or something similar that would not allow insertion on table 1 when view 3 is empty."

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!