1

Hi I am quite new to Oracle SQL Developer. It looks like a very simple thing, but it is driving me nuts.

DEFINE START_DATE = "to_date('03/01/2018', 'dd/mm/yyyy')";
DEFINE END_DATE = "to_date('01/06/2018', 'dd/mm/yyyy')";

SELECT  
    SOMETABLE.JOB_BASE_NUM,
    SOMETABLE.CUSTOMER_CODE
FROM
    SOMETABLE
WHERE              
    SOMETABLE.WORK_END_DATE>= &START_DATE
    AND SOMETABLE.WORK_END_DATE < &END_DATE;

It always ask me to Enter value for END_DATE:

enter image description here

Can someone help please? Thank you.

Edit: I run this in SQL Developer:

enter image description here

3
  • 1
    Are you running all the Lines in the script as one batch or just SELECT? Commented Nov 16, 2018 at 19:39
  • One batch in SQL developer Commented Nov 16, 2018 at 19:47
  • By the way, Oracle supports the ANSI standard syntax for date literals, e.g. date '2018-01-03' Commented Nov 17, 2018 at 10:50

1 Answer 1

2

Remove the semicolon here:

DEFINE START_DATE = "to_date('03/01/2018', 'dd/mm/yyyy')"
DEFINE END_DATE = "to_date('01/06/2018', 'dd/mm/yyyy')"

The semicolon is separating your define variable from your sql.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.