Warm tip: This article is reproduced from stackoverflow.com, please click
date oracle oracle-sqldeveloper sql toad

Error on sql-dev "date format picture ends before converting entire input string", not on toad

发布于 2020-04-13 10:01:43

Hello I have this query to get the first day of the month :

select concat(  REPLACE(TRUNC(to_date(CURRENT_DATE, 'dd-mm-yyyy'), 'mm') ,TO_CHAR(CURRENT_DATE, 'yy'), ''),TO_CHAR(CURRENT_DATE, 'yyyy')) from dual

But when I execute it SQL DEVELOPER I got error ORA-01830

And when I execute it on toad I got the good result : '01-FEB-2020'

How can I do to be worked on these two environnement

Thanks

Questioner
DEVLOGIN
Viewed
53
Littlefoot 2020-02-03 17:25

Is there any reason for doing a simple thing in such a complex manner? The result you need is

select trunc(current_date, 'mm') from dual;

By the way, current_date is a function that returns date so TO_DATE-ing it is wrong.