Show
Ignore:
Timestamp:
09/01/09 03:06:58 (5 years ago)
Author:
jesus
Message:

fix the proc and add code to support it

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ddl/cornea.sql

    r35 r36  
    6767-- 
    6868 
    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 representation 
    70     LANGUAGE plpgsql STABLE 
     69CREATE 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 
    7171    AS $$ 
    7272DECLARE 
    7373        v_rep representation%rowtype; 
    7474BEGIN 
    75         SELECT * FROM representations WHERE 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; 
    7676        IF NOT FOUND THEN 
    77                 INSERT INTO representations (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) 
    7878                VALUES($2, $1, $3, $4, $5, $6, $7); 
    7979        ELSE 
    80                 UPDATE representations SET 
     80                UPDATE representation SET 
    8181                representation_name = $3, distance = $4, representation_count = $5, byproduct_of = $6, transform_class = $7 WHERE representation_id = $2 and service_id = $1; 
    8282        END IF;