Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: using views in select statements

Re: using views in select statements

From: bmlam <bmlam_at_online.de>
Date: Thu, 21 Oct 1999 22:31:56 +0200
Message-ID: <380F783C.EF6AF06D@online.de>


Another usage I can think of is FLEXIBILITY:

suppose in a client server environment the SELECT statements are hard wired on in the clients code (or at least the table/view name and column names). When you re-design your database, i.e, restructure the tables (should not happen every week, though), you can provide views that still support the client's SQL statements without having to change the client code. If the code exists on hundreds or tausends or more machines, you will learn to appreciate views.

James Hanway schrieb:

> I look at views as if they are just a "stored SQL statement". One of the
> advantages of this is that once a view is created, its statement is stored.
> Once Oracle parses that statement, any other references to that view will be
> already parsed.
>
> By explicitly running the sql statement every time, you run the risk of the
> added time of oracle having to re-parse your sql statement. In order for 2
> sql statements to match, they must be IDENTICAL in everty asspect: spaces,
> upper vs lower case, etc. If anything is even remotely different, it is
> treated as a different query and the statement is parsed. Parsing is usually
> quick, but it is an extra step Oracle has to do.
>
> Another option you may want to look at is Snapshots. If your queriey is a
> complicated one or returns many rows, you may want to run it as a snapshot.
> The results of the query are put into the snapshot at a regular basis, and
> you can reference the snapshot just as you would any table or view. I
> believe there is lots of documentation in the Oracle Admin manuals on
> snapshots.
>
> kal121_at_yahoo.com wrote:
>
> > Hello all,
> >
> > What is the general opinion of using views instead of tables in a query?
> >
> > For example, is it better to run a query against four separate tables or
> > against a single view that already contains the relevant columns from
> > those four tables? I know it is hard to answer this without seeing the
> > query(s), but I'd just like a general opinion on this.
> >
> > Thanks
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
Received on Thu Oct 21 1999 - 15:31:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US