vermap vermap - 11 days ago 5
SQL Question

How to use date variable in sql developer's "Enter Binds" dialog?

I am trying to run a query from sql developer and query has variables (

:var
). I am having problem with the date variables.

I used all the possible combinations to format date using
to_date()
function.
Every time getting below exception:

ORA-00932: inconsistent datatypes: expected DATE got NUMBER
00932. 00000 - "inconsistent datatypes: expected %s got %s"
*Cause:
*Action:


Sorry can't post image here

Answer

Try changing your query to be:

select first_name,
       last_name,
       dob,
       org
  from emp
 where dob > to_date(:highDate,'DD-MON-YYYY');

then when prompted, enter '20-JAN-2010'.