Re: Creating valid and well-formed XML-output willy schrieb:
>
> However, when I run this query I get the following error:
> ORA-01427: single-row subquery returns more than one row.
> Apparantly I should convert the result of the subquery into a single
> row.
> Any suggestions on how to do this?
>
> Willy Tadema
>
It seems, your relational design is not ok, if relationship between
employees and departments is not n:1, but n:m, so you need an additional
table to resolve this relationship. If you have done this step, then you
could join both tables and get result in tabular form (however you
would get some rows for every employee employed in more than one
department). To get results as you wish, you'll need some kind
aggregation, from here transform into xml is basic thing. If you could
post ddl for your tables, somebody can suggest appropriate query for you.
Best regards
Maxim |