Re: duda sobre function en postgress

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: Pepe Ballaga <pepe(at)transnet(dot)cu>
Cc: Ayuda Postgres <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: duda sobre function en postgress
Date: 2005-06-18 20:49:55
Message-ID: c2d9e70e0506181349671fd1e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

> CREATE OR REPLACE FUNCTION adminahora(text, text)
> RETURNS int4 AS
>
seguro que quieres regresar un valor?? sino ponle void

> $BODY$
> BEGIN
> perform nombre,clave from admin where nombre=$1 and clave=$2
>
falta punto y coma (;) al final

> if not found then
> insert into admin values($1,$2,null,null)
>
falta punto y coma (;) al final

> else
> update admin set clave=$2 where nombre=$1
>
falta punto y coma (;) al final

> end if;
>
RETURN [valor si decidistes que deseas retornar un valor];

> end;
> $BODY$
> LANGUAGE 'plpgsql' VOLATILE;
> ALTER FUNCTION adminahora(text, text) OWNER TO postgres;

--
Atentamente,
Jaime Casanova
(DBA: DataBase Aniquilator ;)

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Jaime Casanova 2005-06-18 20:56:44 Re: Mensaje de desbordamiento
Previous Message Jaime Casanova 2005-06-18 20:47:40 Re: duda sobre function en postgress