Subject Re: [ib-support] Re: Create view with union
Author Martijn Tonies
Well, this is taken from an IB6 database:

CREATE VIEW PRIJSLIJSTREGELS
(
HOOGTE,
POTMAAT,
POTSOORT,
AANTALPERFUST,
AANTALDOZEN,
OPMERKING,
INKOOPPRIJS,
LOCATIE,
DATUM,
LEV_NAAM,
LEV_ADRES,
LEV_PLAATS,
LEV_TELEFOON,
LEV_FAX,
LEV_ID,
LEV_VBA,
LEV_BVH,
ARTIKELOMSCHRIJVING,
VBNCODE,
HANDELSAFKORTING,
ARTIKELID,
ARTIKELKENMERKID,
ARTIKELKENMERK,
PRIJSLIJSTREGELID,
PRIJSLIJSTID,
LABAANBODNR,
VERKOOPPRIJSKONTAINER,
VERKOOPPRIJSLAAG,
VERKOOPPRIJSSTUK
) AS
select pr1.hoogte, pr1.potmaat, pr1.potsoort, pr1.aantalperfust,
pr1.aantaldozen,
pr1.opmerking, pr1.inkoopprijs, pr1.locatie, pr1.datum,
pr1.lev_naam, pr1.lev_adres, pr1.lev_plaats, pr1.lev_telefoon,
pr1.lev_fax, pr1.lev_id,
pr1.lev_vba, pr1.lev_bvh,
cast(pr1.artikelomschrijving as varchar(107)), pr1.vbncode,
cast(pr1.handelsafkorting as varchar(50)), cast(pr1.artikelid as
numeric(18,0)),
cast(pr1.artikelkenmerkid as numeric(18,0)), cast(pr1.artikelkenmerk
as varchar(35)),
pr1.prijslijstregelid, pr1.prijslijstid, cast(pr1.labaanbodnr as
integer),
pr1.verkoopprijskontainer, pr1.verkoopprijslaag, pr1.verkoopprijsstuk
from v$prijslijstregels_artikelnull pr1
/* test */
union all

select pr2.hoogte, pr2.potmaat, pr2.potsoort, pr2.aantalperfust,
pr2.aantaldozen,
pr2.opmerking, pr2.inkoopprijs, pr2.locatie, pr2.datum,
pr2.lev_naam, pr2.lev_adres, pr2.lev_plaats, pr2.lev_telefoon,
pr2.lev_fax, pr2.lev_id,
pr2.lev_vba, pr2.lev_bvh,
cast(pr2.artikelomschrijving as varchar(107)), pr2.vbncode,
cast(pr2.handelsafkorting as varchar(50)), cast(pr2.artikelid as
numeric(18,0)),
cast(pr2.artikelkenmerkid as numeric(18,0)), cast(pr2.artikelkenmerk
as varchar(35)),
pr2.prijslijstregelid, pr2.prijslijstid, cast(pr2.labaanbodnr as
integer),
pr2.verkoopprijskontainer, pr2.verkoopprijslaag, pr2.verkoopprijsstuk
from v$prijslijstregels_artikelid pr2
;


It compiles in IB6.

What tool are you using to do this?


With regards,

Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com

See you at the First European Firebird Conference in May in Fulda, Germany
http://www.firebird-conference.com

> Hello,
>
> According to:
>
> http://bdn.borland.com/article/0,1410,25099,00.html
>
> this is not fixed. In fact I´m now using IB6 and having
> the problem! I was able to finally create the view
> using embedded SQL (as Borland describes in the article),
> but it was impossible with ISQL or Delphi.
>
> Thanks
>
> --- In ib-support@yahoogroups.com, "Martijn Tonies" <m.tonies@u...>
> wrote:
> > Hi,
> >
> > > Is the wellknown "create view with union clause" problem solved
> > > in firebird??
> >
> > This was fixed in IB6.

>