Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error "Date format picture ends before converting entire input string"

Blue BirdMar 5 2018 — edited Mar 7 2018

Hi

I have a problem with executing a procedure with date parameter from SQL Developer and I would need some help here.

I have a package and procedure inside with next signature:

Procedure MyProc(par_Year In Date, par_Exit_Code Out PLS_Integer, par_Exit_Message Out VarChar2) As

    var_Input_Date Date := To_Date(par_Year, 'DD.MM.YYYY'); -- User Input

...

End;

I call this procedure from APEX application as Process:

Declare

  var_Exit_Code PLS_Integer;

  var_Exit_Message VarChar2(4000);

Begin

  MyPackage.MyProc(To_Date(:P10_Year, 'DD.MM.YYYY'), var_Exit_Code, var_Exit_Message);

...

End;

and it works Ok. I supply Year over DatePicker control, where I choose one date.

Now I would like to call this same procedure from SQL Developer, where I supply some date, to get some more info from my code. I call it this way:

Declare

  var_Exit_Code PLS_Integer;

  var_Exit_Message VarChar2(4000);

  var_Input VarChar2(25) := '10.01.2018';

Begin

  MyPackage.MyProc(To_Date(var_Input, 'DD.MM.YYYY'), var_Exit_Code, var_Exit_Message);

...

End;

And when I run this PL/SQL block I get next error message:

ORA-01830: date format picture ends before converting entire input string.

What I'm doing wrong here? Why the same code work from Apex app, but not from SQL Developer?

In SQL Developer I have Database > NLS set to: DD.MM.YYYY HH24:Mi:SS, if this help anything to solve the problem.

Any clear explanation an solutions are welcome.

BB

This post has been answered by Gaz in Oz on Mar 5 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 4 2018
Added on Mar 5 2018
14 comments
6,996 views