PL/SQL code using :1, :2, :3 and so on
-
14-02-2021 - |
Pergunta
What is the meaning of this code and what do you call this method? How will I know what is the value for :1, :2, :3 and so on?
(PL/SQL Procedure)
UPDATE tablename
SET column = :1, column = :2, column = :3, column = :4, column= :5....
Solução
Those are bind variables. Oracle substitutes them for actual values which are passed. These are generally found when you're using Dynamic SQL, EXECUTE-IMMEDIATE
, OR OPEN-FOR-USING
as mentioned by Phil.
If you want to know what values are being held there, you probably would wnat to look up where the UPDATE
statements are being issued & log them to a logging/debugging table just before the UPDATE
statement is issued
Outras dicas
Is this in SQL*Plus?
If so, they are parameter placeholders. SQL*Plus will prompt you for values upon execution.
If you're coming from a SQL client / programming language (Java, PHP, C#, etc) these would usually represent parameters in a prepared statement though I'm not sure if digit only placeholders are valid.
Update
This can also appear in dynamic SQL executed using an OPEN-FOR-USING
statement. Without seeing more of your code, I'm only guessing.