current position:Home>Oracle has customized a date function. What's wrong with this writing?

Oracle has customized a date function. What's wrong with this writing?

2022-02-03 01:07:27 CSDN Q & A

CREATE OR REPLACE function ORL_NOW_DATE ()
return DATE
is datatime DATE;
begin
datatime := select TO_DATE(to_char(sysdate,'yyyy-mm-dd'),'yyyy-mm-dd') from dual;
return (datatime);
end;




Refer to the answer 1:

You do it again , Read the newspaper without making mistakes .




Refer to the answer 2:



Refer to the answer 3:

The run function can be run in this way :

CREATE OR REPLACE function ORL_NOW_DATE
return DATE
is datatime DATE;
begin
RETURN TO_DATE(to_char(sysdate,'yyyy-mm-dd'),'yyyy-mm-dd');
end;




Refer to the answer 4:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202030107258986.html

Random recommended