Re: Ayuda con una funcion...

From: "Esteban Gutierrez" <ergutier(at)articlynx(dot)cl>
To: "Esteban Gutierrez" <ergutier(at)articlynx(dot)cl>
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Ayuda con una funcion...
Date: 2005-07-06 15:37:31
Message-ID: 49992.200.50.111.197.1120664251.squirrel@mail.articlynx.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Solucionado... Utilicé cursores :)

> Hola mundo.
>
> Tengo una funcion y no me esta funcionando (valga la rebundancia). la
> funcion es la siguiente:
>
> CREATE OR REPLACE FUNCTION nuevo_login(VARCHAR, VARCHAR, VARCHAR, VARCHAR,
> VARCHAR, VARCHAR) RETURNS varchar AS'
> DECLARE
> login varchar;
> -- login_table varchar;
> BEGIN
> FOR i IN 1 .. length($1) LOOP
> login := substr($1,1,i);
> login := login || \'.\';
> login := login || $2;
>
> select mae_login INTO login_table from usuarios_maestro
> where mae_login=login;
>
> IF login_table.mae_login is null THEN
>
> INSERT INTO usuarios_maestro VALUES ($3, login,
> $4, $5, $6);
> drop table login_table;
> RETURN login;
> exit;
>
> ELSE
> drop table login_table;
> RAISE NOTICE ''El valor de i es %'', i;
> END IF;
> END LOOP;
>
> END;
>
> ' LANGUAGE 'plpgsql';
>
> /**********************************************/
>
> si ejecuto la funcion de esta manera:
>
> select nuevo_login('esteban', 'gutierrez','ssss','aa','a','a');
>
> devuelve lo siquiente:
> NOTICE: El valor de i es 1
> ERROR: no existe la relación con OID 1066920
> CONTEXT: PL/pgSQL function "nuevo_login" line 12 at if
>
> alguien me puede decir donde esta el error???
>
> Gracias
>
>
>
>
> ---------------------------(fin del mensaje)---------------------------
> TIP 7: no olvides aumentar la configuración del "free space map"
>
>

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Manuel Sugawara 2005-07-06 16:01:07 Re: mayúsculas y minúsculas en postgress
Previous Message Paùl espin Huayamabe 2005-07-06 15:31:52 UPGRADE......