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.
Thanks for your question. The double colon represents a scope qualifier. In this instance, users are able to GRANT permission to objects like SCHEMA, LOGIN, ect. The double colon tells SQL Server that SCHEMA is the class.
The colon (:) is used to select "slices" from arrays. (See Section 5.12.) In certain SQL dialects (such as Embedded SQL), the colon is used to prefix variable names. The asterisk (*) has a special meaning when used in the SELECT command or with the COUNT aggregate function.
In addition to using cast, you can use :: to cast a value to a specific type.
CREATE TEMP FUNCTION InsertColons(s STRING) AS ( CONCAT(SUBSTR(s, 1, 2), ':', SUBSTR(s, 3, 2), ':', SUBSTR(s, 5, 2)) ); SELECT s, InsertColons(s) AS result FROM ( SELECT '123456' AS s UNION ALL SELECT '170519' );
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With