Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL and bind variables
Eduardo Rene Rodriguez Avila wrote:
>
> I was wondering if is could be posible assign a table or column name to
> a variable and use that variable in a SQL statement within PL/SQL code.
>
I hope the Oracle representative misunderstood your question!
Table names and column names *cannot* be dynamically assigned through
bind variables in PL/SQL. However, it is possible in PL/SQL to use the
DBMS_SQL package
to prepare and execute a dynamically-constructed SQL statement in which
table names and/or column names are included as part of the statement.
(Note that in SQL*Plus, table names and variable names can be entered as substitution variables (e.g. &table_name), but this is because these are substituted by SQL*Plus *before* the statement is submitted to the parser)
Hope this helps.
Chrysalis. Received on Wed Feb 26 1997 - 00:00:00 CST