I might be wrong, but I think there is a certain precedence on date formats to use, and the session one, if defined, would override the server's.
Do a select sysdate from dual, this should show the date format in effect for your session; if its different and you want to use the same, you need to modify/set your relevant NLS environment variable/registry entry to match that on the server.
Just set the format preferences: tools => preferences . . .
I don't think I have any sessions format setup in my script.
Also I go to tools- preference -database-NLS, the date format is DD-MON-RR, same as server, so it goes back to my original question, why it asks me to enter the format of
why it asks me to enter the format of YYYY-MM-DD
The code is generated on the client side (SQL Developer). This code generation, by its design, does not take into account the current NLS_DATE_FORMAT of the session. Instead, it uses the hard coded date format YYYY-MM-DD. It seems to be a design decision.
If you want to enter that date value in a particular format, use the following snippet directly in the SQL worksheet (F5: Run script), modified for your desired date format, or the date format omitted - which I really discourage to do so.
P_DATESTORED := to_date('&myinput', 'YYYY-MM-DD');
P_DATESTORED => P_DATESTORED