Payables and Cash Management - EBS (MOSC)

MOSC Banner

Avoid insert the same value for two rows oracle

edited Aug 28, 2019 5:00AM in Payables and Cash Management - EBS (MOSC) 2 commentsAnswered

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

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center