Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Compare two rows
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