Re: CURRENTE_DATE

Поиск
Список
Период
Сортировка
От Ray O'Donnell
Тема Re: CURRENTE_DATE
Дата
Msg-id 01020192b98778c0-78365d74-1341-45c8-b0de-cc6b962afcf9-000000@eu-west-1.amazonses.com
обсуждение исходный текст
Ответ на CURRENTE_DATE  ("Rossana Ocampos" <rocampos@bry-it.com>)
Ответы Re: CURRENTE_DATE
Список pgsql-general
On 22/10/2024 12:31, Rossana Ocampos wrote:
@font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; margin-bottom:.0001pt; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-fareast-language:EN-US;}a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;}a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:purple; text-decoration:underline;}span.E-MailFormatvorlage17 {mso-style-type:personal-compose; font-family:"Calibri","sans-serif"; color:windowtext;}.MsoChpDefault {mso-style-type:export-only; font-family:"Calibri","sans-serif"; mso-fareast-language:EN-US;}div.WordSection1 {page:WordSection1;}

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
ray@rodonnell.ie

В списке pgsql-general по дате отправления: