What does the colon sign ":" do in a SQL query?

That's called a bind variable in Oracle.

what's the name for ":"?

Colon.


Colon : is used in HQL Hibernate Query Language to signify that there is a parameter involved.

So what that means is: SQL SYNTAX:

SELECT * FROM EMPLOYEE WHERE EMP_ID = empID

is same as HQL SYNTAX:

SELECT * FROM EMPLOYEE WHERE EMP_ID = :empID

empID being local variable for parameters...

Hope this helps.


What does ":" stand for in a query?

A bind variable. Bind variables allow a single SQL statement (whether a query or DML) to be re-used many times, which helps security (by disallowing SQL injection attacks) and performance (by reducing the amount of parsing required).

How does it fetch the desired value?

Before a query (or DML) is executed by Oracle, your program will create a cursor. Your program issues the SQL to be parsed for that cursor, then it must bind values for each bind variable referred to by the SQL. How this is done depends on the language.

What is that sign called?

A colon.