Re: PL/SQL question!!!!!
Date: 1996/04/18
Message-ID: <4l5k4n$8se_at_homer.alpha.net>#1/1
Use dynamic PL/SQL
Esther Salk (esalk_at_luc.ac.be) wrote:
> Hello out there,
> 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;
> Any help is welcome.
> Esther Salk
> --
-- ************************************************************** * Saad Ahmad * * Senior Software Engineer * * McHugh Freeman & Associates, Inc. * * Ph: (414) 798-7457 * * Fax: (414) 798-8619 * * E-Mail: sahmad_at_mfa.com * **************************************************************Received on Thu Apr 18 1996 - 00:00:00 CEST