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: Query..

Re: Query..

From: Carlos <miotromailcarlos_at_netscape.net>
Date: 20 Mar 2006 23:24:16 -0800
Message-ID: <1142925855.941437.257540@e56g2000cwe.googlegroups.com>


Daniel:

I'm not sure if you are answering me. But, since you quoted my answer, I proceed:

>>Though you could make it a lot easier by fixing the table as it is quite poorly designed.

I agree. But my intention was to give the OP a hint to pivotate HIS table, not to change his design.

>>The table you describe should have only three columns.

I agree again. (But again, It was not my design).

>>Every line of your code will break if you add another column the way you have it designed.

Here, I have to say NO. If you implement a view as, for example,

CREATE VIEW demo_vw
AS
SELECT NAME, 'ENGLISH' LANGUAGE , ENGLISH VAL FROM demo
UNION ALL
SELECT NAME, 'FRENCH' LANGUAGE , FRENCH VAL FROM demo
UNION ALL
SELECT NAME, 'SPANISH' LANGUAGE , SPANISH VAL FROM demo
UNION ALL
SELECT NAME, 'GERMAN' LANGUAGE , GERMAN VAL FROM demo

It will be working, no matter how many columns you add. Another thing is that the view will not show the new columns (languages?) you add. (You can also rebuild the view to show them).

Cheers.

Carlos Received on Tue Mar 21 2006 - 01:24:16 CST

Original text of this message

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