PL SQL Embedded Statements
PL SQL Embedded Statements
3. Can you use the same name for a variable and a column?
Yes, but it's not recommended as it can lead to ambiguity. If a variable and a column have
the same name, PL/SQL will give preference to the variable by default. To avoid confusion,
you can use aliases in the SQL statement to distinguish between the column and the
variable.
Example:
SELECT column_name
INTO variable_name
FROM table_name
WHERE column_name = variable_name;