Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle: Accessing Record Fields (dynamically)
datDude wrote:
> Oracle: Accessing Record Fields (dynamically)
>
> Discussion Item
>
> I'm currently looping through my cursor of records. The fields of the
> record that i need to access are not known until runtime ie
> input_rec.event_label is a valid statement to access the value for the
> input_rec.event_label val.
>
> In my present scenerio event_label is not hardcoded, it's dynamic.
>
> My question:
> Is it possible to access a record field value dynamically ie.
> input_rec.[field_name] where field_name = event_label.
>
> This is my scenerio, I need to access record field values but I wont
> know which field I need to access until runtime.
>
> If this is possible, someone please let me know
No. Nor does your statement about the column names being dynamic make any sense without you posting information on version and the PL/SQL.
What I gather from what you've posted is likely a very bad design and little else. The actual PL/SQL and some business case information might help understand the point of this exercise so we can help you find a solution.
-- Daniel A. Morgan Relational theory is not something that is simply a nice-to-have. http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Thu May 26 2005 - 19:12:52 CDT