Changeset 36 for trunk/ddl/cornea.sql
- Timestamp:
- 09/01/09 03:06:58 (4 years ago)
- Files:
-
- trunk/ddl/cornea.sql (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ddl/cornea.sql
r35 r36 67 67 -- 68 68 69 CREATE OR REPLACE FUNCTION make_representation(in_service_id smallint, in_repid smallint, in_name text, in_distance integer, in_count integer, in_parent smallint, in_transform text) RETURNS SETOF representation70 LANGUAGE plpgsql STABLE69 CREATE OR REPLACE FUNCTION make_representation(in_service_id smallint, in_repid smallint, in_name text, in_distance integer, in_count integer, in_parent smallint, in_transform text) RETURNS VOID 70 LANGUAGE plpgsql 71 71 AS $$ 72 72 DECLARE 73 73 v_rep representation%rowtype; 74 74 BEGIN 75 SELECT * FROM representation sWHERE service_id = $1 and representation_id = $2 INTO v_rep;75 SELECT * FROM representation WHERE service_id = $1 and representation_id = $2 INTO v_rep; 76 76 IF NOT FOUND THEN 77 INSERT INTO representation s(representation_id, service_id, representation_name, distance, representation_count, byproduct_of, transform_class)77 INSERT INTO representation (representation_id, service_id, representation_name, distance, representation_count, byproduct_of, transform_class) 78 78 VALUES($2, $1, $3, $4, $5, $6, $7); 79 79 ELSE 80 UPDATE representation sSET80 UPDATE representation SET 81 81 representation_name = $3, distance = $4, representation_count = $5, byproduct_of = $6, transform_class = $7 WHERE representation_id = $2 and service_id = $1; 82 82 END IF;
