I have two tables:
Stockitem (serialno, qty) serialno is the primary key
and
Order(serialno,orderno,qty) orderno and serialno are the primary keys.
I want to create a trigger in order to ensure that when I input the quanitity in the Order table, the quantity should be less than that of the Stockitem. How can I accomplish this? I am using Oracle SQL.
Best Answer
According to your question the sample tables are follows:
Table:ORDERS
The following trigger may solve your problem.