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:47:40
Message-ID: c2d9e70e0506181347231a614f@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 entero? sino ponle void
> $BODY$
> BEGIN
> perform nombre,clave from admin where nombre=$1 and clave=$2
falta punto y coma (;)

> if not found then
> insert into admin values($1,$2,null,null)
falta punto y coma (;)
> else
> update admin set clave=$2 where nombre=$1
falta punto y coma (;)
> end if;
return [valor si decidistes que si desea que rgrese un valor] ;
> end;
> $BODY$
> LANGUAGE 'plpgsql' VOLATILE;
> ALTER FUNCTION adminahora(text, text) OWNER TO postgres;
>
>
> PEPE
>
> Pepe Ballaga
> Analista de Sistemas
> SITRANS. La Habana Cuba
> Tel: 8624685
> pepe(dot)ballaga(at)gmail(dot)com
> ----- Original Message -----
> 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>
> Sent: Thursday, June 16, 2005 6:18 PM
> Subject: Re: [pgsql-es-ayuda] duda sobre function en postgress
>
>
> > On 6/16/05, Pepe Ballaga <pepe(at)transnet(dot)cu> wrote:
> >> 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.
> >>
> >
> > Logico, no le estas poniendo "RETURN valor_entero;" al final, eso te
> > falta.
> >
> > --
> > Atentamente,
> > Jaime Casanova
> > (DBA: DataBase Aniquilator ;)
> >
> >
> >
>
>
>

--
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:49:55 Re: duda sobre function en postgress
Previous Message Nicolas Sorich 2005-06-17 21:51:40 " Problemas para migrar fotos"