cxgn_breedbase
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
store_gene_genesynonym(integer, integer, integer)
Parameters
Name
Type
Mode
integer
IN
integer
IN
integer
IN
Definition
DECLARE pgenesynonym_id ALIAS FOR $1; pgene_id ALIAS FOR $2; ppub_id ALIAS FOR $3; pkeyid INTEGER; BEGIN SELECT INTO pkeyid 0 FROM gene_genesynonym WHERE gene_genesynonym.genesynonym_id = pgenesynonym_id AND gene_genesynonym.gene_id = pgene_id AND gene_genesynonym.pub_id = ppub_id; IF NOT FOUND THEN INSERT INTO gene_genesynonym (genesynonym_id, gene_id, pub_id) VALUES (pgenesynonym_id, pgene_id, ppub_id); RETURN currval('0'); END IF; UPDATE gene_genesynonym SET WHERE gene_genesynonym.genesynonym_id = pgenesynonym_id AND gene_genesynonym.gene_id = pgene_id AND gene_genesynonym.pub_id = ppub_id RETURN pkeyid; END;