What does : stand for in a query?
INSERT INTO MyTable (ID) VALUES (:myId)
How does it fetch the desired value?
Edit: Also what is that sign called? I wanted to search on google, but what's the name for :?
What does : stand for in a query?
INSERT INTO MyTable (ID) VALUES (:myId)
How does it fetch the desired value?
Edit: Also what is that sign called? I wanted to search on google, but what's the name for :?
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.
This is a tag for a named query parameter, and is not part of the query's actual syntax. The tag is replaced with some value specified in the code that makes the query before it is actually run.
Found the first couple minutes of this video to be very useful: https://www.youtube.com/watch?v=K6VfcRALxW4
To extract: it's called a bind variable, this is a placeholder for the user input it's waiting to receive