Avoid insert the same value for two rows oracle
Hi,
I do the below query:
CREATE OR REPLACE TRIGGER RIB BEFORE INSERT OR UPDATE ON ap_supplier_sites_all
FOR EACH ROW
DECLARE totover number(10);
BEGIN
totover := 0;
SELECT count(1) INTO totover FROM ap_supplier_sites_all WHERE ap_supplier_sites_all.attribute4 = :NEW.attribute4; (Check whether any pending order exists or not )
IF (totover > 0) THEN
RAISE_APPLICATION_ERROR(-20101, 'This RIB exists with another Suppliers.Please try with a new RIB');
END IF;
END;
i want to avoid insert or update if the attribute4 exists in the table. but i have the issue
can you help me,
thanks