🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #11232

Re: View based on a UNION of 2 Select's

#11232
From: Martijn Tonies
Date: Thu, 12 Dec 2002 13:08
129 lines
3875 bytes
Hi Jose,

You might want to try with IB 6.5 or 7 when the download comes available.


--

With regards,

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

"This is an object-oriented system.
If we change anything, the users object."

> IB 6.0.2.0.
> the same happens with 6.0.1.0 too.
>
> thanks
>
> Jose Carlos
>
> "Martijn Tonies" <m.tonies@upscene_remove.com> escreveu na mensagem
> news:3df775a5$1@newsgroups.borland.com...
> > Hi,
> >
> > What version of IB are you using? I recall a bug in earlier versions
> > that messed up the PLAN that IB returned.
> >
> >
> > --
> >
> > With regards,
> >
> > Martijn Tonies
> > InterBase Workbench - the developer tool for InterBase & Firebird
> > Firebird Workbench - the developer tool for Firebird
> > Upscene Productions
> > http://www.upscene.com
> >
> > "This is an object-oriented system.
> > If we change anything, the users object."
> >
> > >
> > >   I Have the following tables and view :
> > >
> > > CREATE TABLE TAB1
> > > (
> > >   COD INTEGER NOT NULL,
> > >   DESCR VARCHAR(10),
> > >   CODTAB INTEGER,
> > >   TYPETAB VARCHAR(1)
> > > );
> > >
> > > CREATE TABLE TAB2
> > > (
> > >   COD INTEGER NOT NULL,
> > >   DESCR VARCHAR(10)
> > > );
> > >
> > > CREATE TABLE TAB3
> > > (
> > >   COD INTEGER NOT NULL,
> > >   DESCR  VARCHAR(10)
> > > );
> > >
> > > CREATE VIEW V_TABS
> > > (
> > >   COD,
> > >   DESCR,
> > >   TYPETAB
> > > )
> > > AS
> > > SELECT
> > >   COD,
> > >   DESCR,
> > >   '2'
> > >   FROM
> > >     TAB2
> > >
> > > UNION
> > >
> > > SELECT
> > >   COD,
> > >   DESCR,
> > >   '3'
> > >   FROM
> > >     TAB3;
> > >
> > >
> > >   My problem happens when I try to run the following
> > > select :
> > >
> > > SELECT
> > >     TAB1.COD,
> > >     TAB1.DESCR,
> > >     TAB1.TYPETAB || ' - ' || V_TABS.DESCR
> > >   FROM
> > >     TAB1
> > >     LEFT OUTER JOIN V_TABS
> > >     ON (  (V_TABS.CODTAB = TAB1.CODTAB)
> > >         AND
> > >           (V_TABS.TYPETAB = TAB1.TYPETAB))
> > >
> > >   The select return the records I want but my plan analyser tool goes
> crazy
> > > and show a lot of unrecognized characters instead of the correct plan.
> Am I
> > > doing something wrong ? Can I trust that my select will always work ?
> > >
> > > Is there some problem using a VIEW based on a UNION of two SELECT's ? Is
> it
> > > safe ?
> > >
> > > Do you have some other idea ?
> > >
> > > Thanks for reading.
> > >
> > > Jose Carlos
> > > Brazil
> > >
> > >
> >
> >
>
>
Technical Details
Message-ID: <3df8899d@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!diablo.netcom.net.uk!netcom.net.uk!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3df76de6@newsgroups.borland.com> <3df775a5$1@newsgroups.borland.com> <3df85be9@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114a0e,2f86d9a520aeb76b
X-Google-Attributes: gid114a0e,public
X-Google-ArrivalTime: 2002-12-12 05:22:20 PST
From: "Martijn Tonies" <m.tonies@upscene_remove.com>
Newsgroups: borland.public.interbase.sql
References: <3df76de6@newsgroups.borland.com> <3df775a5$1@newsgroups.borland.com> <3df85be9@newsgroups.borland.com>
Subject: Re: View based on a UNION of 2 Select's
Date: Thu, 12 Dec 2002 14:08:26 +0100
Lines: 131
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 212.238.179.102
Message-ID: <3df8899d@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1039698333 212.238.179.102 (12 Dec 2002 05:05:33 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!diablo.netcom.net.uk!netcom.net.uk!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail