From: | Raymond O'Donnell <rod(at)iol(dot)ie> |
---|---|
To: | Günce Kaya <guncekaya14(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Fwd: parameter type is unknown error |
Date: | 2017-03-06 11:57:38 |
Message-ID: | 90778e42-c123-055a-8c1f-c1169daab1f1@iol.ie |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-sql |
On 06/03/17 11:36, Günce Kaya wrote:
> Hi all,
>
> I created a dummy table and related function that include insert script.
> When I execute the function I'm getting error like bellow;
>
> ERROR: function cargo.insertinvoice(integer, integer, integer,
> *unknown, unknown, unknown*, integer, timestamp with time zone, integer,
> integer, money, timestamp with time zone, timestamp with time zone,
> timestamp with time zone) does not exist
>
> LINE 1: select * from cargo.insertinvoice(1013, 10, 44, 'asda','test...
>
> ^
>
> HINT: No function matches the given name and argument types. You might
> need to add explicit type casts.
>
>
> Table's create script as bellow;
>
> CREATE TABLE cargo.invoice
> (
> id bigserial NOT NULL,
> orderid integer NOT NULL,
> cargoid integer NOT NULL,
> invoiceowner integer NOT NULL,
> invoiceaddress character(250) NOT NULL,
> receiverfname character varying(50) NOT NULL,
> receiverlname character varying(50) NOT NULL,
> receiverphone integer NOT NULL,
> sendingdatetime timestamp without time zone DEFAULT now(),
> distance real NOT NULL,
> weight numeric NOT NULL,
> addedtax numeric NOT NULL DEFAULT 8,
> invoiceamount money DEFAULT 0,
> cargocreateddate date,
> cargoupdateddate timestamp without time zone,
> cargocancelled timestamp without time zone);
>
> The function that content insert script to cargo.invoice table is following;
>
> create or replace function cargo.insertinvoice (forderid integer,
> fcargoid integer, finvoiceowner integer, finvoiceaddress character,
> freceiverfname character varying, freceiverlname character varying,
> freceiverphone integer, fsendingdatetime timestamp without time zone,
> fdistance real, fweight numeric, finvoiceamount money,
> fcargocreateddate date, fcargoupdateddate timestamp, fcargocancelled
> timestamp without time zone) returns numeric as $$
>
> declare v_id bigint;
>
> begin
>
> insert into cargo.invoice (orderid, cargoid, invoiceowner,
> invoiceaddress, receiverfname, receiverlname, receiverphone,
> sendingdatetime, distance, weight, addedtax, invoiceamount,
> cargocreateddate, cargoupdateddate, cargocancelled)
> values(forded, fcargoid, finvoiceowner, finvoiceaddress,
> freceiverfname,freceiverlname,freceiverphone, fsendingdatetime,
> fdistance, fweight, faddedtax, finvoiceamount, fcargocreateddate,
> fcargoupdateddate, fcargocancelled);
>
> select max(id) into v_id from cargo.invoice;
>
> return v_id;
>
> end;
>
> $$ language plpgsql;
>
>
> So, when I execute the function like;
>
> select * from cargo.insertinvoice(1013, 10, 44, 'asda','test1','test2',
> 12345, now(), 10000,30, 400, now(), now(), now());
You've declared the function with type "character" for the fourth
parameter, but you're trying to pass a varchar or text value.
Ray.
--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie
From | Date | Subject | |
---|---|---|---|
Next Message | Günce Kaya | 2017-03-06 12:00:34 | Re: Fwd: parameter type is unknown error |
Previous Message | Charles Clavadetscher | 2017-03-06 11:51:49 | Re: Fwd: parameter type is unknown error |
From | Date | Subject | |
---|---|---|---|
Next Message | Günce Kaya | 2017-03-06 12:00:34 | Re: Fwd: parameter type is unknown error |
Previous Message | Charles Clavadetscher | 2017-03-06 11:51:49 | Re: Fwd: parameter type is unknown error |