Re: function with unknown params

From: Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>
To: giozh <giozh(at)yahoo(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: function with unknown params
Date: 2013-07-09 16:50:23
Message-ID: CA+h6AhhJ=zhZYv7CJbxnTyDfL6zdOnEop0TZ0Yrok=P=evMCnw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jul 9, 2013 at 10:00 PM, giozh <giozh(at)yahoo(dot)it> wrote:

> i've declared and implemented e function like:
>
> CREATE OR REPLACE FUNCTION acquistoLotto(m_g INTEGER, grossista
> VARCHAR(20),
> produttore BIGINT, costo INTEGER, dat DATE, descr VARCHAR(120), num_prod
> INTEGER) RETURNS VOID AS $$
>
> but when i'm trying to call it like
>
> select acquistoLotto(0, 'grossista', 52187073424, 10, 22/1/2013, 'ciao ciao
> ciao', 10);
>
> Seems you missing on how to pass date field. Try this it will work.

postgres=# select acquistoLotto(0, 'grossista', 52187073424, 10,
'1-22-2013', 'ciao ciaociao', 10);
acquistolotto
---------------

(1 row)

or

postgres=# select acquistoLotto(0, 'grossista', 52187073424, 10,
'1-22-2013'::date, 'ciao ciaociao', 10);
acquistolotto
---------------

(1 row)

---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Muhammad Bashir Al-Noimi 2013-07-09 17:02:58 Re: Force ssl connection
Previous Message Alvaro Herrera 2013-07-09 16:49:14 Re: function with unknown params