Re: Variables as Column names in PL/SQL

From: Bo Lu <bo.lu_at_hsc.utah.edu>
Date: 1996/07/22
Message-ID: <31F3CD5A.7A0_at_hsc.utah.edu>#1/1


Geoff Dewhurst wrote:
>
> Hi,
> Does any one know we can pass a variable into a function and use this as
> a column name in an UPDATE statement. We tried using DECODE but it can not
> be used in an UPDATE statement.
> TIA
PL/SQL wouldn't like a dynamic column name. But you can handle it with DBM_SQL package, which could dynamically compile and run your SQL script.

But I did find a problem with DBMS_SQL. For example, I need run "alter system flush shared_pool" once a while to clean up the the shared pool using a job, which in turn calls a stored procedure. Since Oracle stored procedure dosen't like that statement, I use the DBMS_SQL to run it within the stored procedure. The stored procedure works fine. But "alter system flush shared_pool" doesn't seem take place.

-- 
Bo Lu
Senior Programmer/Analyst
Hospital and Clinical Informatics, U. of Utah
801-581-5964, bo.lu_at_hsc.utah.edu
Received on Mon Jul 22 1996 - 00:00:00 CEST

Original text of this message