Re: Función

From: Eduardo Morras <emorras(at)s21sec(dot)com>
To: "Mario Soto Cordones" <msotocl(at)gmail(dot)com>
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Función
Date: 2009-06-30 14:17:55
Message-ID: 20090630141530.3C9054C802B@s21sec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

At 02:40 30/06/2009, you wrote:
>
>Hola Lista, tengo la siguiente función:
>
>CREATE OR REPLACE FUNCTION
>"public"."inspropiedades" (char, smallint,
>smallint, integer, smallint, smallint, smallint,
>varchar, varchar, varchar, smallint, smallint,
>smallint, varchar, varchar, varchar, varchar,
>varchar) RETURNS "pg_catalog"."void" AS
<snip>...
>select * from inspropiedades('SA', 1, 1, 109, 1,
>1, 3, 'CASA QUINTA CARMEN', 'DIRECCION', 'CALLE
>CARMEN', 30, 13, 1,'1-6','1-6','123456','REFERENCIA','MSOTO')
>
>Y me da el siguiente error:
>
>ERROR: function inspropiedades(unknown,
>integer, integer, integer, integer, integer,
>integer, unknown, unknown, unknown, integer,
>integer, integer, unknown, unknown, unknown, unknown, unknown) does not exist
>LINE 1: select * from inspropiedades('SA', 1, 1, 109, 1, 1, 3, 'CASA...
> ^
>HINT: No function matches the given name and
>argument types. You might need to add explicit type casts.

... char sin poner el tamaño no es char(1)? Luego
lo llamas con 'SA' que es un char(2).

Prueba a definir la funcion con un char(3). Al
hacer la llamada te hara un padding con espacios
hasta 3, lo que no recuerdo ahora es si sera ' SA' o 'SA '.

Un saludo

-------------------------------------------------------------------------
Useful Acronyms: GPL = Greedy Pengüin Licence

In response to

  • Función at 2009-06-30 00:40:40 from Mario Soto Cordones

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2009-06-30 14:22:57 Re: ESPACIOS EN BLANCO EN UNA QUERY
Previous Message juan 2009-06-30 14:17:32 Re: Función