🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#162
From: Wayne Niddery (TeamB)
Date: Tue, 24 Jun 2008 17:27
33 lines
2088 bytes
"Karol Bieniaszewski" <liviuslivius@poczta.onet.pl> wrote in message 
news:4860e8bb$1@newsgroups.borland.com...
>
> 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???

It is showing you the plans for each view in the query. When trying to 
specify your own plan, you can only specify *one* as far as I know - for 
your own query, not the underlying views.

So likely this would be ok:
 select * from
 XXX B
 PLAN (B NATURAL)

However, you really should not be specifying your own plans. In almost all 
cases a query can be optimized simply by adjusting the structure or by 
adding appropriate indexes. Using you own plans should be ab absolutely last 
resort only.

-- 
Wayne Niddery - TeamB (www.teamb.com)
Winwright, Inc. (www.winwright.ca) 
Technical Details
Message-ID: <48612e73@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4860e8bb$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,5ab8d73ddeb2b166
X-Google-Attributes: gid114a0e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Wayne Niddery \(TeamB\)" <wniddery@chaffaci.on.ca>
Newsgroups: borland.public.interbase.sql
References: <4860e8bb$1@newsgroups.borland.com>
In-Reply-To: <4860e8bb$1@newsgroups.borland.com>
Subject: Re: Plan for query from VIEW problem .. dynamic sql error sql error code = -104 Token unknown .. PLAN
Date: Tue, 24 Jun 2008 13:27:00 -0400
Lines: 34
MIME-Version: 1.0
Content-Type: text/plain;
 format=flowed;
 charset="iso-8859-1";
 reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6001.18000
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18000
NNTP-Posting-Host: 24.137.214.213
Message-ID: <48612e73@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1214328435 24.137.214.213 (24 Jun 2008 10:27:15 -0700)
X-Authenticated-User: wniddery
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail