Re: PL/SQL question!!!!!

From: Alvin W. Law <alaw_at_oracle.com>
Date: 1996/04/19
Message-ID: <ALAW.96Apr18220909_at_ap283sun.oracle.com>#1/1


In article <4l4p3m$or0_at_vivaldi.belnet.be> esalk_at_luc.ac.be (Esther Salk) writes:
>
> Can anybody tell me how I can solve the following problem?
>
> I'have got a Oracle table, initially created with 2
> columns. But in time, several other columns have to be
> added to this table, storing the name of these columns
> somewhere else. My question is the following:
> How can I get to the contents of a specefic column
> (through a query in PL/SQL), not directly knowing the
> name of this column, but through use of a variable
> containing this column name.
>
> For example: the variable COLUMNNAME contains the
> name of a column of table TABLE_X, I want to get
> something like this:
>
> DECLARE
> ...
> BEGIN
> ...
> SELECT x FROM table_x WHERE columnname = 'some_value';
> ...
> END;
In you are using PL/SQL 2.1, you should check out the dynamic SQL support with dbms_sql. Received on Fri Apr 19 1996 - 00:00:00 CEST

Original text of this message