Dataphor SQL RAC (Relational Application Companion)

A site of hope for those looking for a true relational database system

Saturday, June 16, 2007

Dataphor - Intelligent views

This is in response to the thread:

Saturday, June 16, 2007 10:10 AM
How to make a view as input???

MS Sql Server 2005 Bol on View:
 'Creates a virtual table that represents the data in one or more tables
  in an alternative way.' 
This is a good and accurate defintion. It is a 'representation' of a 
select statement. But it does not 'capture' the relationship(s) of the
representation. It is unaware of any key(s) and most importantly unaware
of any constraints between tables, ie. reference(s). It thus suffers from
a deficit disorder as far as application development goes. This retardation
causes developers to assume responsibilities the db should handle amongst
which is the use of the nightmare t-sql trigger.

Here is a very simple example of intelligent view behavior for application
development. It uses the D4 language of Dataphor and uses sql server 2005
as the data respository.

create table MyOrders

create table MyOrderDetails
  reference MyDetails_MyOrders{ order_nbr } 
  references MyOrders { order_nbr }

insert table
  row{1 order_nbr, 15 some_col},
 } into MyOrders;
insert table
  row{1 order_nbr, 1 sku, 500 item_price},
  row{1, 2, 205},
  row{2, 1, 490},
  row{3, 1, 480}
 } into MyOrderDetails ; 

This is a natural join. The sql "on MyOrders.order_nbr=MyOrderDetails.order_nbr"
is implied by a natural join.

create view MyOrdersView
  MyOrders join MyOrderDetails 

The keys of each table and the constraint (reference) between the
tables are used to resolve each insert into the view. The view inherits
the keys of each table and the reference between the tables.

insert row{1 order_nbr,3 sku,253 item_price} into MyOrdersView;
insert row{2 order_nbr,2 sku,321 item_price} into MyOrdersView;
insert row{4 order_nbr,1 sku,42 some_col,321 item_price} into MyOrdersView;

select MyOrdersView;
order_nbr some_col sku item_price 
--------- -------- --- ---------- 
1         15       1   500        
1         15       2   205        
1         15       3   253        
2         30       1   490        
2         30       2   321        
3         14       1   480        
4         42       1   321        

An insert should be resolved to a delete followed by an insert from the
view to each base table, ie. an update.
(The "adorn" is meta-data attached to the insert allowing the update
 behavior to take place thru the view).

insert row{1 order_nbr,3 sku,25 some_col,632 item_price} into MyOrdersView
                           adorn with { PropagateInsert = "Ensure" };

select MyOrdersView;                         
order_nbr some_col sku item_price 
--------- -------- --- ---------- 
1         25       1   500        
1         25       2   205        
1         25       3   632        
2         30       1   490        
2         30       2   321        
3         14       1   480        
4         42       1   321           

select MyOrders;
order_nbr some_col 
--------- -------- 
1         25       
2         30       
3         14       
4         42       

select MyOrderDetails;
order_nbr sku item_price 
--------- --- ---------- 
1         1   500        
1         2   205        
1         3   632        
2         1   490        
2         2   321        
3         1   480        
4         1   321        

Before one asks the question of whether or not there is intelligence
in the universe, developers should ask if there is intelligence in
their application tools -:)
bye for now,


dghnfgj said...

welcome to the wow gold, cheap WoW Power Leveling, service site,wotlk gold buy cheap wow gold,wow gold,world of warcraft power leveling buy wow gold

Anonymous said...

Nice to meet you!!!
[URL=]queens restaurant week 2010[/URL]

Anonymous said...

Nice to meet you!!!

Anonymous said...

My first test blog.
my first test blog
[url=] my first test blog [/url]

qishaya said...

one day i went shopping outside,and in an ed hardy store,I found some kinds of ed hardy i love most they are Your website is really good Thank you for the information ed hardy ed hardy ed hardy clothing ed hardy clothing ed hardy shoes ed hardy shoes don ed hardy don ed hardy ed hardy clothes ed hardy clothes ed hardy bags ed hardy bags ed hardy swimwear ed hardy swimwear ed hardy jeans ed hardy jeans ed hardy mens ed hardy mens Thank you for the information

Cris said...

HI friends, this information is very interesting, I would like read more information about this topic, thanks for sharing. homes for sale in costa rica

niz said...

Hello .. firstly I would like to send greetings to all readers. After this, I recognize the content so interesting about this article. For me personally I liked all the information. I would like to know of cases like this more often. In my personal experience I might mention a book called Generic Viagra in this book that I mentioned have very interesting topics, and also you have much to do with the main theme of this article.

Anonymous said...

Christian Louboutin Rolando Hidden-Platform Black Pumps
Christian Louboutin Rolando Hidden-Platform Dark Red Pumps
Christian Louboutin Rolando platform pumps
Christian Louboutin Ronda Dina 140 platform pumps
CHRISTIAN LOUBOUTIN Ronron 100 Patent Pumps (Bleu)
CHRISTIAN LOUBOUTIN Ronron 100 Patent Pumps (Noir)

free incest porn pics and stories said...

I wanted to feel every inch of this black cock. I didnt do nothing.
stories bisexual first time
free 3d xxx toon stories
free ture sex stories gay
interracial stories with pictures
embarrassing animal sex stories
I wanted to feel every inch of this black cock. I didnt do nothing.

Anonymous said...

لدي بعض الحكمة الرائعة.

Anonymous said...

Das war wirklich interessant. Ich liebte es zu lesen

Anonymous said...

There is obviously a lot to know about this. I think you made some good points in Features also. Keep working ,great job!.

muebles torrejon de ardoz said...

I believe everyone ought to browse on it.

Anonymous said...

writing enhancement software top ten review tally accounting software china [url=]blu ray software[/url] blackberry 8100 free software download
[url=]PostgreSQL Data Wizard 7.8 - Download OEM, Software Sale, OEM Software[/url] palm pilot desktop software

Anonymous said...

apothecary pharmacy los angeles marchese pharmacy in hamilton ontario [url=]phentermine without a prescription at a us pharmacy[/url]
virginia board of pharmacy rite aid pharmacy mount vernon [url=]celebrex[/url]
formulary nas jrb pharmacy online pharmacy for dexedrine [url=]pharmacy technician jobs dallas texas[/url]
dispan pharmacy definition wegmans pharmacy perington ny [url=]activ8 energy booster [/url]

Anonymous said...

sunset pharmacy walgeen pharmacy online [url=]nd board of pharmacy[/url]
naval medical center portsmouth pharmacy pharmacy manufacturer 3592 [url=]vitamin c[/url]
a new rx pharmacy anabolic steroid pharmacy sites [url=]genovis pharmacy[/url]
canadian levitra lipitor mexican online pharmacy pharmacy omnicare pharmacy new jersey [url=]kamasutra ribbed condoms[/url]

Anonymous said...

When you are purchasing, you are much more likely to stick to your finances when you pay only with cash. Select how a lot you will invest. Choose the amount of financial savings from coupon codes you will acquire. Then just take that quantity of money with you purchasing. You will simply acquire the thing you need and you may be encouraged to employing all of your coupon codes should you retail outlet with income only. [url=]Tiffany And Co[/url]
Make unsubscribing to the portable ad simple and easy to improve your impression with all the consumer. As challenging as it may be to produce unsubscribing easy, your people will look at you as a reasonable and worthwhile vendor that they could rely on. Chances are great that anyone that unsubscribes was not going to obtain anyways which means you save yourself some useless advertising as well! [url=]Nike Shox Australia[/url]
When you're employed as a system online marketer, you certainly must be responsible. If a person feels the item you offered them is false, or should it be bogus, you ought to be liable. Dismissing your responsibility might cause expression to spread, producing a diminishing community with out income. [url=]Scarpe Mbt[/url]
One particular wonderful suggestion for deciding on what pumping systems to utilize is to go with kinds that match the colour of the epidermis. Not merely could this be just going to be strategies for what is going to more often than not look really good, but it will even help to extend the look of your thighs. [url=]Michael Kors[/url]
Look for a whitening teeth program which fits into your life and plan. Some demand long periods of time using a gel or some other product on your teeth. When you have a busy routine with little down time, this can not meet your needs. Other programs need several therapies throughout a day. Select one which fits your life-style. Network is among the brightest issues you can do while you are in school. This will help not only to widen your band of good friends, but in addition develop your possibilities when you find yourself out of college or university searching for a work. Will not dismiss any individual in college, as they might be important for your future. [url=]Nike High Heels[/url]

Anonymous said...

essex dating free intimate encounter dating sites
dating tips for kids [url=]speed dating rules prices[/url] dating checklist
virtual dating flash games [url=]atheists dating[/url] who is john alagia dating [url=]jazmine[/url] dating free internet services totally

About Me

My photo
Phoenix, Arizona, United States