Re: what is the error in the function?

From: "Aasmund Midttun Godal" <postgresql(at)envisity(dot)com>
To: efreyre(at)qnet(dot)com(dot)pe
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: what is the error in the function?
Date: 2001-11-09 14:21:39
Message-ID: 20011109142139.31293.qmail@ns.krot.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

As the error message suggests you may need to cast the types so that it knows what kind of data you are putting in, perhaps like so:

select nr_renewlease('111.111.111.111'::VARCHAR,'50 seconds'::TIMESTAMP)

I am not sure, look it up in the docs.

Regards,
Aasmund.
On Thu, 8 Nov 2001 17:52:51 GMT, efreyre(at)qnet(dot)com(dot)pe wrote:
> Dear Sirs:
>
> Please I have a function as:
>
> create function nr_renewLease(varchar(15),interval)
> returns integer as '
> DECLARE
> local_address ALIAS FOR $1;
> lease_duration ALIAS FOR $2;
> BEGIN
> update nr_lease set expires=now()+lease_duration where
> address=local_address;
> END;
> return 1;
> '
> language 'plpgsql';
>
> When I called this function so:
>
> select nr_renewlease('111.111.111.111','50 seconds')
>
> I get the follow error :
>
> ERROR: Function 'nr_renewlease(unknown, unknown)' does not
> exist Unable to identify a function that satisfies the given
> argument types You may need to add explicit typecasts.
>
> I don't know where is the fail.
>
> I will thank if you can help me to clarify this.
>
> Regards,
>
> Ernesto
>
> ---------------------------------------------
> Este mensaje fue enviado a través de Qnet
> http://www.qnet.com.pe
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

Aasmund Midttun Godal

aasmund(at)godal(dot)com - http://www.godal.com/
+47 40 45 20 46

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brent R. Matzelle 2001-11-09 14:30:34 Re: Postgre for Windows
Previous Message Ivan Babikov 2001-11-09 10:24:43 Are 2-phase commited transaction available in Postgres?