1

I'm using Oracle SQL Developer to test a query to be used in an ADF application's read only view object. ADF documentation recommends using an uppercase letter to begin the name of a bind variable. So... I've creatively named mine :BindVariable

Funky part is SQL Developer appears to dislike bind variables that begin with an upper case letter.

This query works

select * from tablename
where id like :bindVariable

This one does not

select * from tablename
where id like :BindVariable

Am I correct in understanding that bind variable names cannot begin with an upper case letter? Or is there something else amiss here?

EDIT

Is this just an Oracle SQL Developer thing? :BindVariable works just fine in JDeveloper's database navigator.

Thanks for reading! Any input will be greatly appreciated.

User404
  • 2,152
  • 2
  • 27
  • 35
IdusOrtus
  • 1,005
  • 1
  • 16
  • 24

1 Answers1

3

Oracle SQL Developer: can bind variables begin with upper case letter?

Yes.

There is no issue with SQL Developer. I have tested it on version 3.2.20.10

Please see the screenshots:

Query:

enter image description here

Result:

enter image description here

No issues in SQL*Plus either:

SQL> variable BindVariable VARCHAR2(20)
SQL> EXEC :BindVariable := 'SMITH'

PL/SQL procedure successfully completed.

SQL> SELECT empno FROM emp WHERE ename LIKE :BindVariable;

     EMPNO
----------
      7369

SQL>
Lalit Kumar B
  • 47,486
  • 13
  • 97
  • 124
  • Perhaps it is a version difference. We use Oracle SQL Developer Version 2.1.1.64 and JDK6 by default. I'm downloading SQL Developer 4.1.0.19 now and will give it a test in the morning. Thank you very much for the time and input. – IdusOrtus May 08 '15 at 05:54
  • You're welcome. It might be a version specific issue. Please let me know if newer version fixes the issue. – Lalit Kumar B May 08 '15 at 06:18
  • Seems like a version issue. I opted to install 3.2.20.09 instead of 4.1.0.19 (didn't require JDK8) and the issue is resolved. Thanks again for the help! – IdusOrtus May 08 '15 at 14:40
  • @IdusOrtus So, the issue is certainly version specific. Thanks for the feedback. – Lalit Kumar B May 08 '15 at 14:52