From: "Bob Badour" <bbadour@golden.net>
Newsgroups: comp.databases.theory
Subject: Re: parameterised SQL views
Date: Sat, 21 Oct 2000 23:23:19 -0400
Organization: Golden Triangle Online
Lines: 30
Message-ID: <8stmot$rt$1@cougar.golden.net>
References: <39DDBD0A.FA50AE4B@keele.ac.uk> <8s21e8$d5p$1@nnrp1.deja.com> <39E5A4ED.D8A735A5@keele.ac.uk> <8s9fod$rj0$1@cougar.golden.net> <8sfp24$ruj$1@bw107zhb.bluewin.ch> <39F05756.F3AD9AEA@keele.ac.uk>
NNTP-Posting-Host: as53-01-103.cas-gue.golden.net
X-Trace: cougar.golden.net 972185181 893 207.35.144.103 (22 Oct 2000 03:26:21 GMT)
X-Complaints-To: abuse@golden.net
NNTP-Posting-Date: 22 Oct 2000 03:26:21 GMT
X-Newsreader: Microsoft Outlook Express 4.72.3110.1
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3


Hi Paul,

I certainly did not mean to imply in any way that views have no use. They
have many uses.

Going back to the earlier example, what would happen if the DateFrom and
DateUntil columns were derived from data in a different table, and you had a
view like:

Create View Emp as
select e.*
      , h.date as DateFrom
      , coalesce(t.date,'99991231') as DateUntil
from ( employee e join job_record h
           on e.empid = h.empid
        ) left outer join  job_record t
        on h.empid = t.empid
        and h.job_id = t.job_id
where h.record_type = 'Hire'
  and t.record_type = 'Term'
;

Consider how much more complex the Prolog might be without the view (Y10K
problem notwithstanding).

Regards,
Bob




