1
votes

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.

1

1 Answers

3
votes

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>