Subject Re: Multiselect or something like that
Author Svein Erling Tysvær
Hi Majstoru!

OK, that was a good explanation of your problem, but I don't think
you'll like my answer...

Firebird is a database where you define fields in tables and records
contain values in the fields. A field can be viewed as a column and a
record as a row.

What you seem to want to do is to somehow change rows into columns,
and I don't think that is possible in a general sense (it don't think
it would be impossible if you could say that there would always be two
such columnrows, but a various number sounds impossible).

So, is your problem unsolvable? No, but it is a matter of how you
present your data and nothing that Firebird can do for you. Firebird
may give you the result in rows, and then your client program (not
Firebird) should transform this into columns before display. Likewise,
your program would have to transform changes into updates that
Firebird understands.

I would expect there to be components around that could assist in
doing what you want to do, I have just never been in your situation so
I don't know them.

Also, I would be happy if I'm wrong and that someone else would show
that a query or stored procedure could fix your problem. It just
sounds impossible with a variable number of columns.

Set

--- In firebird-support@yahoogroups.com, "majstoru" wrote:
> Hi,
>
> Here is a closer explanation of my problem, it is something like
> cross query (like MS Access)!
>
> If I have 3 tables Customers, Articles and Qty with metadata:
>
> 1. Articles
> id smallint
> name varchar
>
> 2. Customers
> id smallint
> name varchar
> city varchar
>
> 3. Qty
> id smallint
> art_id smallint
> cust_id smallint
> qty integer
>
> So, that is a metadata and I must return something like:
>
> X -> Articles
> y -v Customers
>
> Art01 Art02 Art03 . . .
> Cust01 Qty1 Qty5 Qty3
> Cust02 Qty9 Qty7 Qty2
> Cust03 Qty1 Qty1 Qty1
> .
> .
> .
>
> And. At the end of these process of my problem, this query must be
> UPDATEABLE!!!
>
> I think that is a little closer that previous sample!!!
>
> Thanks