🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Plan for query from VIEW problem .. dynamic sql error sql error code = -104 Token unknown .. PLAN

#160
From: Karol Bieniaszewski
Date: Tue, 24 Jun 2008 12:30
37 lines
1615 bytes
Hi

i create View with select with union of two tables

some like

CREATE VIEW XXX(AAA)
SELECT A.AAA FROM TABLE_A A /* first query */
UNION
SELECT B.BBB FROM TABLE_B B /* second query */

now i try to select from thises View

select * from XXX B
i get plans
PLAN (B A NATURAL)
PLAN(B B NATURAL)

but if i try

select
*
from
XXX B
PLAN (B A NATURAL)
PLAN(B B NATURAL)

i get error "dynamic sql error sql error code = -104 Token unknown .. PLAN

how can i store plan for this type of query???

in real project i have
e.g good plan for second query of view but for first is wrong plan and i can 
not change it :(

please help
Karol Bieniaszewski
Technical Details
Message-ID: <4860e8bb$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,5ab8d73ddeb2b166,start
X-Google-Attributes: gid114a0e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Karol Bieniaszewski" <liviuslivius@poczta.onet.pl>
Newsgroups: borland.public.interbase.sql
Subject: Plan for query from VIEW problem .. dynamic sql error sql error code = -104 Token unknown .. PLAN
Date: Tue, 24 Jun 2008 14:30:01 +0200
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 195.205.151.58
Message-ID: <4860e8bb$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1214310587 195.205.151.58 (24 Jun 2008 05:29:47 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail