PL/SQL code using :1, :2, :3 and so on

mysticfalls picture mysticfalls · Oct 27, 2011 · Viewed 9k times · Source

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....

Answer

Phil picture Phil · Oct 27, 2011

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.