public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ray O'Donnell <[email protected]>
To: Rossana Ocampos <[email protected]>
To: [email protected]
Subject: Re: CURRENTE_DATE
Date: Wed, 23 Oct 2024 13:18:36 +0000
Message-ID: <01020192b98778c0-78365d74-1341-45c8-b0de-cc6b962afcf9-000000@eu-west-1.amazonses.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

On 22/10/2024 12:31, Rossana Ocampos wrote:
>
> *Hello ,*
>
> I am new with PostgreSQL and I have a bug. I have created a function 
> that has an input variable of type date , in case it does not receive 
> value , it has to assume by default the current date.
>
> I have defined it as follows variable  DATE DEFAULT CURRENT_DATE, but 
> I get the following error.
>
> *_El error _*
>
> ERROR: invalid input syntax for type date: “CURRENT_DATE” LINE 1: 
> ...extsupplydate ('1085018'::bigint, '5278'::bigint, 'CURRENT_D... ^ 
> ERROR: invalid input syntax for type date: “CURRENT_DATE” SQL status: 
> 22007 Characters: 78
>

I think you just need to leave off the quotes, as current_date is a 
function:

   insert into .... values ( ... , current_date, ....);

Also, you don't need to quote the bigint values.


HTH,

Ray.


> Please could you help me, thank you very much.
>
> Rossana
>


-- 
Raymond O'Donnell // Galway // Ireland
[email protected]


view thread (5+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: CURRENTE_DATE
  In-Reply-To: <01020192b98778c0-78365d74-1341-45c8-b0de-cc6b962afcf9-000000@eu-west-1.amazonses.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox