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

Home -> Community -> Usenet -> c.d.o.misc -> Re: how to change dynamically field name when using recordtype

Re: how to change dynamically field name when using recordtype

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Fri, 20 Feb 2004 09:57:27 -0800
Message-ID: <1077299808.209216@yasure>


Basant wrote:

> Hi,
> I want to change the field name of a recordtype dynamically to
> compare two values. For Example.
>
> TYPE Rec IS RECORD (name VARCHAR2(300),
> Roll NUMBER);
> Student Rec;
>
> FUNCTION isEqual (l_Student Rec,
> ColumnName VARCHAR2,
> Value VARCHAR2)
> BEGIN
> IF 'l_Student'||Columnname = Value THEN
> RETURN TRUE;
> ELSE
> RETURN FALSE;
> END IF;
> END;
>
> Calling funciton as :
> l_Student Rec;
> BEGIN
> l_Student.Name:='JOHN';
> isEqual(l_student,'.Name','JOHN');
> END;
>
> I have already tried with Dynamic SQL . But didn't got any option to
> do like this.
>
>
> Help me out...
>
> Thanks in Advance.
> Basant

Help you out with what? You provided no version or edition information and no error message or indication of what is wrong.

But the first thing I'd do is:

SELECT keyword FROM v$reserved_words
WHERE keyword LIKE 'NA%';

SELECT keyword FROM v$reserved_words
WHERE keyword LIKE 'RO%';

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Fri Feb 20 2004 - 11:57:27 CST

Original text of this message

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