7

Possible Duplicate:
What does the colon sign “:” do in a SQL query?

Simple SQL question: What does : stand for?

For example:

SELECT * FROM myTable
WHERE Employee_column = :P_EmplId;

The : isn't exactly easy to google when you don't know what this is called. Even searching here didn't help. I'm using Oracle 11g if that makes any difference.

Community
  • 1
  • 1
Gunnar
  • 2,585
  • 4
  • 21
  • 22

2 Answers2

13

It is a bind variable:

A placeholder in a SQL statement that must be replaced with a valid value or value address for the statement to execute successfully. By using bind variables, you can write a SQL statement that accepts inputs or parameters at run time. The following example shows a query that uses v_empid as a bind variable:

Taryn
  • 242,637
  • 56
  • 362
  • 405
4

Most likely you took the query from a template. It is meant to be processed with php's MDB2 sql framework. The ":" (colon) signals a placeholder in the statement, meant to be replaced when the query is executed.

arkascha
  • 41,620
  • 7
  • 58
  • 90