Reputation: 41
I got a condition that, whenever the 3 columns
(`OMIMAGE` varchar(255) DEFAULT NULL,
`suspendedCase` varchar(255) DEFAULT NULL,
`futureDated` varchar(255) DEFAULT NULL,)
gets data, insertion into another table needs happen. All the 3 columns must get data.
Is there any other best alternative instead of using trigger.
Upvotes: 2
Views: 370
Reputation: 17071
On database level, you have nothing but trigger for this case.
There is another tiny feature which you can use for ensuring that value is not null
:
create table tbl (
OMIMAGE varchar(255) NOT NULL,
suspendedCase varchar(255) NOT NULL,
futureDated varchar(255) NOT NULL
)
But in this case you can only ensure that value is not null, you cannot guarantee that it isn't empty string etc...
Upvotes: 1