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: Oracle: Accessing Record Fields (dynamically)

Re: Oracle: Accessing Record Fields (dynamically)

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 26 May 2005 19:02:58 -0700
Message-ID: <1117159115.848325@yasure>


datDude wrote:
> more info
>
> I have this collection of n records (field names are different per row)
> row_id: 1
> file_id: 1
> field_name_1: airtime_charges
> field_value_1: 60
> field_name_2: airtime_sur_charges
> field_value_2: 70
> field_name_3: intl_sur_charges
> field_value_3: 80
>
> row_id: 2
> file_id: 2
> field_name_1: local_charges
> field_value_1: 100
> field_name_2: intl_charges
> field_value_2: 20
> field_name_3: roaming_charges
> field_value_3: 80

This is impossible. You can not select two rows and have different column names. If you want help you need to explain what it is you are actually doing. And still no version number.

If these rows come out of a table they must have the same name. If they are coming from a user interface then the problem is bad design. Where you choose to stick them, or how you choose to process them should be controlled by an additional column named something like "ROW_TYPE" that indicates the type of data.

And in case you think I don't know your business ... I have spent multiple year consulting for phone companies including AT&T Wireless (now Cingular), US West Communications, AccessLine Communications, and T-Mobile. So I am highly inclined to assign this the "bad design" label and recommend you rethink what you are doing and how.

Open minded, however, I still await version number and enough information to reconsider that opinion.

-- 
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 - 21:02:58 CDT

Original text of this message

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