mysql error while trying to insert a timestamp

Asked

Viewed 66 times

0

I’m trying to pass a timestamp per parameter for a Function, but I end up getting an error

ERROR:  invalid input syntax for type time: "10"

the stretch where I pass is:

select agendar('2010-01-01 10:00:01')

the stretch you receive is:

CREATE OR REPLACE FUNCTION agendar(dia timestamp) returns bool as $$
declare

-- aqui eu declaro as variaveis....
begin
-- aqui o meu codigo
end
$$ language plpgsql
  • What is the full function body? I suggest removing the mysql tag if it is a function for postgresql.

  • The body contained some operations, the error appeared all the time, so I erased everything and released a true Return; and the error continued

  • @Renanbicudoferrari If you run "select current_timestamp;" is the content being displayed similar to the format of how you are passing the parameter? Also check that when running "show datestyle;" it is with the standard which is "ISO, DMY"

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.