Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Compare two rows

Re: Compare two rows

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 05 Dec 2005 09:11:34 -0800
Message-ID: <1133802675.931507@jetspin.drizzle.com>


paulhux174_at_hotmail.com wrote:
> rec1 testTable%ROWTYPE -- have substaniated this variable
>
>
> How can I reference a column in the record dynamically?
>
> eg:
> instead of using
> value1 := rec1.column1;
> how can I use a variable instead of column1
>
> thisColumn varchar2 (30) := 'column1';
> value1 := rec1(thisColumn);
>
> thisColumn := 'column4';
> value1 := rec1(thisColumn);

Using the DBMS_SQL built-in package.

But as IANAL_VISTA has explained ... there is little chance this is what you should be doing. So what is the business case?

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Mon Dec 05 2005 - 11:11:34 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US