Function para borrar

From: Micky Khan <mcanchas(at)hotmail(dot)com>
To: FORO POSTGRES <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Function para borrar
Date: 2018-05-22 20:08:02
Message-ID: AM4P190MB02252DA6DC7A5E178DBA39D8D7940@AM4P190MB0225.EURP190.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Buenas .

Estoy creando una funcion para borrar y me sale este error :

ERROR: error de sintaxis en o cerca de «$body$
DECLARE
begin

DELETE FROM almacen_crudo WHERE seq_tejido_ejec_detalle = $1 ;

RETURN;

end;
$body$»
LINE 1: ...E FUNCTION public.borrar_rollos ( seq_rollo integer ) $body$

Ya intente varias cosas y en la red no encuentro algun ejemplo.

Gracias por su ayuda...

CREATE OR REPLACE FUNCTION public.borrar_rollos (

seq_rollo integer
)

$body$
DECLARE
begin

DELETE FROM almacen WHERE seq_tejido_ejec_detalle = $1 ;

RETURN;

end;
$body$
LANGUAGE 'plpgsql'
VOLATILE
CALLED ON NULL INPUT
SECURITY INVOKER
COST 100 ROWS 1000;

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2018-05-22 20:26:10 Re: Function para borrar
Previous Message Hellmuth Vargas 2018-05-19 14:40:33 Re: Consulta sobre fechas TimeStamp