Bind references are used to replace a single value in SQL or PL/SQL.
Specifically, bind references may be used to replace expressions in SELECT
,
WHERE
, GROUP BY
, ORDER BY
, HAVING
,
CONNECT BY
, and START WITH
clauses of queries.
Bind references may not be used in a FROM
clause. An example is:
SELECT ORDID,TOTAL
FROM ORD
WHERE CUSTID = :CUST
Lexical references are placeholders for text that you embed in a SELECT
statement, when you want the parameter to substitute multiple values
at runtime. You can use lexical references to replace the clauses appearing
after SELECT
, FROM
, WHERE
, GROUP
BY
, ORDER BY
, HAVING
, CONNECT BY
,
and START WITH
. You cannot make lexical references in PL/SQL. Before
you reference a lexical parameter for a column or table, you must have predefined
the parameter and given it an initial value. . An example is:
SELECT ORDID, TOTAL
FROM &ATABLE
Copyright © 1984, 2005, Oracle. All rights reserved.