Re: pgplsql (no entiendo todavia)

From: "Miguel Angel" <hgmiguel(at)gmail(dot)com>
To: "Jorge Alejandro Adell" <jorgeadell(at)gmail(dot)com>
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: pgplsql (no entiendo todavia)
Date: 2006-07-02 03:08:22
Message-ID: aa9ca9610607012008l17007d81qfc2af6f69d0ac82b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

On 7/1/06, Jorge Alejandro Adell <jorgeadell(at)gmail(dot)com> wrote:
> Estoy con mis primeros pasos con postgres y decidi comenzar por PGPLSQL
> escribi el siguiente archivo llamado test.sql
>
> CREATE or replace FUNCTION funcion() returns integer AS $$
> declare
> x := 33;
> begin
> raise notice 'aprendiendo plpgsql %', 34;
> return 1;
> end;
> $$ LANGUAGE plpgsql;
>
Te hace falta el tipo de la variable x:
x int4 := 33;

en el raise notice sustituye el 34 por la x, aunque no se decirte bien
porque da error ahi.
> ingreso a la base de datos test
> psql test
> create language plpgsql;
> \i test.sql
> y me aparece el siguiente error.
>
> psql:b.sql:8: ERROR: invalid type name ""
> CONTEXT: compile of PL/pgSQL function "funcion" near line 3
>
> Si comento
> declare
> x := 33;
> anda todo y no entiendo que es todavia.
>
> Gracias.
>
> ---------------------------(fin del mensaje)---------------------------
> TIP 3: si publicas/lees desde Usenet, por favor envía "subscribe-nomail"
> a majordomo(at)postgresql(dot)org para que tus mensajes puedan llegar
> a los suscriptores de la lista
>

--
http://hgMiguel.blogspot.com/
hgMiguel(at)gmail(dot)com

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Jorge Alejandro Adell 2006-07-03 06:33:11 RAISE NOTICE aparece dos veces
Previous Message Jorge Alejandro Adell 2006-07-02 02:39:43 pgplsql (no entiendo todavia)