views:

4

answers:

0

Well, i'm trying to achieve something but i think it is not possible. Here's where i am.

SQL Table T with columns colID , colA, colB. colID is the primary key

I needed to retrieve all the values specified in colA "unioned" with colB, so I created a view

CREATE OR REPLACE VIEW vw_MyView (col_Common) AS
(SELECT col_A AS col_Common FROM T UNION SELECT col_B AS col_Common FROM T)

Now the view consists in just one column (colCommon) where all the values from colA and colB go.

I then use a query to retrieve the data from the view ordered and with no duplicates.

The problem is that Zend_Dojo_Data doesn't accept the result set of that query because it does not contain an unique column, raising an exception with the following description

"Item must contain a column matching the currently set identifier"

How can i get around this? It won't matter if i add colID to the view because it does not guarantee its uniqueness.

The thing is, i need to populate a Dojo ComboBox with all the values from colA and colB and not allowing duplicates, but i'm stuck right now.

Any tip?

TIA