cxgn_breedbase
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
store_featureprop(integer, integer, text, integer)
Parameters
Name
Type
Mode
integer
IN
integer
IN
text
IN
integer
IN
Definition
DECLARE pfeature_id ALIAS FOR $1; ppkey_id ALIAS FOR $2; ppval ALIAS FOR $3; pprank ALIAS FOR $4; pkeyid INTEGER; BEGIN SELECT INTO pkeyid featureprop_id FROM featureprop WHERE featureprop.feature_id = pfeature_id AND featureprop.pkey_id = ppkey_id AND featureprop.pval = ppval AND featureprop.prank = pprank; IF NOT FOUND THEN INSERT INTO featureprop (feature_id, pkey_id, pval, prank) VALUES (pfeature_id, ppkey_id, ppval, pprank); RETURN currval('featureprop_pk_seq'); END IF; UPDATE featureprop SET WHERE featureprop.feature_id = pfeature_id AND featureprop.pkey_id = ppkey_id AND featureprop.pval = ppval AND featureprop.prank = pprank RETURN pkeyid; END;