Re: PL/SQL question!!!!!

From: MGaric <mgaric_at_aol.com>
Date: 1996/04/19
Message-ID: <4l9kjp$g8f_at_newsbf02.news.aol.com>#1/1


Another way to query a specific column name via PL_SQL is to pass the name of the column to the SQL script via a parameter. For example, if you have a table called tab_1 and it contains columns a,b,c, and d, you can create your script to look like this:

declare
....

begin

select &1 from tab_1;
....

end

When you run the script you can say something like this:

sqlplus uid/pass _at_script_name PARAMETER1

Parameter1 would contain the name of the column you want. The &1 in the script would be replaced with whatever you pass as parameter1. This works if you know the name of the column when you start your script. If you do not know the name of the column when you strat the script you can query the dba_tab_coulmns view to find the column you want. and you can assign it to a variable.

Let me know if this helps.

-Mark Received on Fri Apr 19 1996 - 00:00:00 CEST

Original text of this message