Re: Error en funcion

From: "masc68(at)gmail(dot)com" <masc68(at)gmail(dot)com>
To: Jenaro Centeno Gómez <jenaro(at)interaprende(dot)net>
Cc: eduardo reyes <allcomsystem(at)gmail(dot)com>, pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Error en funcion
Date: 2010-10-27 18:28:33
Message-ID: AANLkTinWjnqvDvVbQHSWk70g_tBGdgz-qkCbH9iA3fdb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Gracias a todos por sus comentarios, lo solucioné cambiando el tipo
smallint por integer

Saludos

Mario Soto

2010/10/27, Jenaro Centeno Gómez <jenaro(at)interaprende(dot)net>:
> En realidad viendo la definición de la función y el error que te
> devuelve se puede ver que no estas llamando la función con los mismos
> parámetros con los que la creaste, recuerda que en PostgreSQL puedes
> manejar varias funciones con el mismo nombre (sobrecarga).
>
> Saludos.
>
> El 27/10/10 12:18 p.m., eduardo reyes escribió:
>> Saludos..
>> Solo tienes que especificar la longitud de cada campo CHAR(20),
>> VARCAHR(40)
>>
>>
>> 2010/10/26 masc68(at)gmail(dot)com <mailto:masc68(at)gmail(dot)com>
>> <masc68(at)gmail(dot)com <mailto:masc68(at)gmail(dot)com>>
>>
>> Hola lista, tengo un problema con la siguiente función:
>>
>> CREATE OR REPLACE FUNCTION "public"."ins_agencias" (
>> char,
>> smallint,
>> smallint,
>> bigint,
>> numeric,
>> char,
>> varchar,
>> smallint,
>> varchar,
>> varchar,
>> varchar,
>> date,
>> double precision,
>> double precision,
>> varchar
>> )
>> RETURNS "pg_catalog"."void" AS
>> $body$
>> INSERT INTO "public"."eMarketing_agencias"
>> ( id_estado, co_empresa, co_filial, codigo_sap, rut_agencia,
>> dv_agencia, nb_agencia, ty_agencia,
>> nb_contacto, fono_agencia, email_agencia, ult_trabajo,
>> mo_trabajo, mo_total_trabajos,
>> id_usuario) VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9,
>> $10, $11, $12, $13, $14, $15);
>> $body$
>> LANGUAGE 'sql'
>> VOLATILE
>> RETURNS NULL ON NULL INPUT
>> SECURITY INVOKER;
>>
>> Esta es la tabla :
>>
>> CREATE TABLE "public"."eMarketing_agencias" (
>> "id_estado" CHAR(2) DEFAULT 'SA'::bpchar NOT NULL,
>> "co_empresa" SMALLINT DEFAULT 1 NOT NULL,
>> "co_filial" SMALLINT DEFAULT 1 NOT NULL,
>> "codigo_sap" BIGINT DEFAULT 0 NOT NULL,
>> "rut_agencia" NUMERIC(8,0) DEFAULT 0 NOT NULL,
>> "dv_agencia" CHAR(1) DEFAULT ''::bpchar NOT NULL,
>> "nb_agencia" VARCHAR(100) DEFAULT ''::character varying NOT NULL,
>> "ty_agencia" SMALLINT DEFAULT 0 NOT NULL,
>> "nb_contacto" VARCHAR(100) DEFAULT ''::character varying NOT NULL,
>> "fono_agencia" VARCHAR(12) DEFAULT '0'::character varying NOT NULL,
>> "email_agencia" VARCHAR(60) DEFAULT 'aaa(at)aaa(dot)cl
>> <mailto:aaa(at)aaa(dot)cl>'::character varying NOT NULL,
>> "ult_trabajo" DATE,
>> "mo_trabajo" DOUBLE PRECISION DEFAULT 0 NOT NULL,
>> "mo_total_trabajos" DOUBLE PRECISION DEFAULT 0 NOT NULL,
>> "id_usuario" VARCHAR(30) DEFAULT 'eMARKETING'::character varying
>> NOT NULL,
>> "sq_serialcolumn" SERIAL,
>> "fe_creacion" DATE DEFAULT now() NOT NULL,
>> CONSTRAINT "eMarketing_agencias_pk" PRIMARY KEY("co_empresa",
>> "co_filial", "codigo_sap", "rut_agencia"),
>> CONSTRAINT "eMarketing_agencias_sq_serialcolumn_key"
>> UNIQUE("sq_serialcolumn")
>> ) WITHOUT OIDS;
>>
>>
>> Pero al tratar de insertar datos me indica el siguiente error:
>>
>> ERROR: function public.ins_agencias("unknown", integer, integer,
>> integer, integer, "unknown", "unknown", integer, "unknown", "unknown",
>> "unknown", "unknown", "unknown", "unknown", "unknown") does not exist
>> HINT: No function matches the given name and argument types. You may
>> need to add explicit type casts.
>>
>>
>> Sinceramente no entiendo que pasa, porque me indica que debo usar cast
>>
>> Saludos a todos
>> -
>> Enviado a la lista de correo pgsql-es-ayuda
>> (pgsql-es-ayuda(at)postgresql(dot)org <mailto:pgsql-es-ayuda(at)postgresql(dot)org>)
>> Para cambiar tu suscripción:
>> http://www.postgresql.org/mailpref/pgsql-es-ayuda
>>
>>
>
>
> --
> ------------------------------------------------------------------------
> *L.A. Jenaro Centeno Gómez*
> *Director de Desarrollo*
> *InterAprende Multimedia*
> *http://www.interaprende.net*
> ------------------------------------------------------------------------
>

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Cesar A 2010-10-27 19:57:03 Re: Slony: fatal error
Previous Message Jenaro Centeno Gómez 2010-10-27 18:11:06 Re: Error en funcion