Código:
El SP ME ACTUALIZA UNA TABLA Y ME INSERTA EN OTRA, MI PREGUNTA ES QUE SI YO AL GENERAR EL TRIGGER YO PUEDO ACTUALIZAR E INZERTAR O TENGO QUE CREAR UN SP PARA ACTUALIZAR Y CREAR EL TRIGGER PARA ACTUALIZAR Y CREAR OTRO SP PARA INSERTAR Y UN TRIGGER PARA INSERTAR-- Function: case_historic(character varying, integer, character varying) -- DROP FUNCTION case_historic(character varying, integer, character varying); CREATE OR REPLACE FUNCTION case_historic(descrip character varying, status integer, id character varying) RETURNS boolean AS $BODY$ BEGIN UPDATE request SET req_description='', stat_id where req_description= descrip and stat_id=stat and req_id=req_id INSERT INTO historic ( req_dateapplication, req_description, stat_id) VALUES (localtimestamp, descrip, stat); ---RETURN passed; END; $BODY$ LANGUAGE plpgsql VOLATILE SECURITY DEFINER COST 100; ALTER FUNCTION case_historic(character varying, integer, character varying) SET search_path=public; ALTER FUNCTION case_historic(character varying, integer, character varying) OWNER TO postgres;
GRACIAS!