SET client_min_messages = notice;
DO $$
DECLARE
__ID_PERSONA INTEGER DEFAULT 1;
__nombres public.persona.nom_persona%TYPE;
_msj TEXT;
BEGIN
SELECT nom_persona
FROM persona
INTO __nombres WHERE nid_persona = __ID_PERSONA;
RAISE NOTICE 'notice is : %', __nombres;
EXCEPTION
WHEN others THEN
GET STACKED DIAGNOSTICS _msj = PG_EXCEPTION_CONTEXT;
raise notice 'ERROR : % %', SQLERRM, SQLSTATE;
END
$$
Ejemplo de función anónima
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.