Ver Mensaje Individual
  #4  
Antiguo 16-01-2012
Avatar de jejo1984
jejo1984 jejo1984 is offline
Miembro
NULL
 
Registrado: jun 2011
Posts: 39
Reputación: 0
jejo1984 Va por buen camino
Aqui tienes otro ejemplo de una funcion insert:

Código SQL [-]
CREATE OR REPLACE FUNCTION insert_tip_demorada(_tipo_nombre character, _descrip_tipo character)
  RETURNS boolean AS
$BODY$
begin
INSERT INTO tipo_demo(tipo_nombre,descrip_tipo) VALUES(_tipo_nombre,_descrip_tipo);
RETURN True;
exception
when integrity_constraint_violation then
RAISE NOTICE 'Rollback to savepoint';
RETURN False;
end;$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;
Responder Con Cita