Skip site navigation (1) Skip section navigation (2)

Error en funcion

From: "masc68(at)gmail(dot)com" <masc68(at)gmail(dot)com>
To: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Error en funcion
Date: 2010-10-26 18:07:43
Message-ID: AANLkTimUM2bqmN=O5vz9x=nNXwnLEJs7z9Yxp2XRNf8N@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-es-ayuda
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'::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

Responses

pgsql-es-ayuda by date

Next:From: Jaime CasanovaDate: 2010-10-26 18:18:21
Subject: Re: Error en funcion
Previous:From: Daniel OrozcoDate: 2010-10-26 17:04:43
Subject: Re: Sentencia DML dinamica.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group