You are here: Re: Idea: new database object that defines a FROM clause « MsSQL Server « IT news, forums, messages
Re: Idea: new database object that defines a FROM clause

Posted by joeNOSPAM@BEA.com on 01/09/07 18:30

On Jan 6, 2:37 pm, "John Rivers" <firs...@btinternet.com> wrote:
> create from dbo.fromExample
> as
> from dbo.Customers c
> join dbo.Invoices i
> on c.CustomerID = i.CustomerID
>
> now you can use it as follows:
>
> select c.CustomerID, i.InvoiceNo
> from dbo.fromExample
>
> I find I reuse FROM clauses alot
>
> and reusing a "base query" requires writing a very large and cumbersome
> select clause

You essentially want a new step in parsing SQL, and a function that
substitutes a long string into the SQL for your before it's really
parsed.
The DBMS can't supply anything fancier because the actual semantics
and the effect on the query plan of any FROM clause are essentially
unbounded. This would be better done somewhere in the client.
Joe Weinstein at BEA Systems

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация