duda sobre function en postgress

From: "Pepe Ballaga" <pepe(at)transnet(dot)cu>
To: "Ayuda Postgres" <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: duda sobre function en postgress
Date: 2005-06-16 20:29:36
Message-ID: 029901c572b2$25fadd70$da64000a@pepesql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

amigos esta es la funcion que cree, pero no me inserta nada en la tabla. por
cierto que la mando a ejecutar en el Query tool de la siguiente manera.
¿esta bien asi?¿que me falta?. creo la funcion. pero no me daningun
resultado. Disculpen tanta preguntadera pero vengo del mundo SQL Server y
necesito un empujoncito. agradezco cualquier ayuda. gracias

select adminahora('pepe','clave')

esta es la funcion

CREATE OR REPLACE FUNCTION adminahora(bpchar, bpchar)
RETURNS int4 AS
$BODY$
BEGIN
perform nombre,clave from admin where nombre=$1 and clave=$2
if not found then
insert into admin values($1,$2,null,null)
else
update admin set clave=$2
end if;
end;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;

aqui se acaba

PEPE

Pepe Ballaga
Analista de Sistemas
SITRANS. La Habana Cuba
Tel: 8624685
pepe(dot)ballaga(at)gmail(dot)com

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2005-06-16 22:15:18 Re: duda sobre function en postgress
Previous Message Jose Rey 2005-06-16 18:39:58 Re: AYUDA CON POSTGRESQL PARA GENERAR UN TXT DE UNA CONSULTA