cxgn_breedbase
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
store_feature_cvterm(integer, integer, integer)
Parameters
Name
Type
Mode
integer
IN
integer
IN
integer
IN
Definition
DECLARE pfeature_id ALIAS FOR $1; pcvterm_id ALIAS FOR $2; ppub_id ALIAS FOR $3; pkeyid INTEGER; BEGIN SELECT INTO pkeyid feature_cvterm_id FROM feature_cvterm WHERE feature_cvterm.feature_id = pfeature_id AND feature_cvterm.cvterm_id = pcvterm_id AND feature_cvterm.pub_id = ppub_id; IF NOT FOUND THEN INSERT INTO feature_cvterm (feature_id, cvterm_id, pub_id) VALUES (pfeature_id, pcvterm_id, ppub_id); RETURN currval('feature_cvterm_pk_seq'); END IF; UPDATE feature_cvterm SET WHERE feature_cvterm.feature_id = pfeature_id AND feature_cvterm.cvterm_id = pcvterm_id AND feature_cvterm.pub_id = ppub_id RETURN pkeyid; END;