| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Updating a column with PL/SQL proc
In article <1f6f1u4jigtf1dh6n5in3lcliv6mq0lbhp_at_4ax.com>, TurkBear says...
>
>I want to dynamically specify a column and its value to update with by calling a
>Pl/Sql proc ..
>The code ( a very simple test) is
>CREATE OR REPLACE Procedure TEST_PLUPDATE (clname varchar2 ,val1 varchar2) IS
>begin
>update test_plup
> set clname = val1;
> end;
>
begin
execute immediate 'update test_plup set ' || clname || ' = :val1' using val1;
end;
>It will not compile since clname is not, at compile time, a column name in
>test_plup..
>
>How can I design a proc that will accept a column name and a value and use those
>to update the table?
>
>Thanks
>*( Oracle 8.1.6)
>
>
>
>-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
>http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> Check out our new Unlimited Server. No Download or Time Limits!
>-----== Over 80,000 Newsgroups - 19 Different Servers! ==-----
-- Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/ Expert one on one Oracle, programming techniques and solutions for Oracle. http://www.amazon.com/exec/obidos/ASIN/1861004826/ Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Wed Dec 12 2001 - 13:15:57 CST
![]() |
![]() |