Re: Updatable views
Date: Wed, 07 Dec 2005 21:48:17 +0100
Message-ID: <qbiep11f3eg8h1mmkqhqskc77ai1r7boq7_at_4ax.com>
Probably in vain but I will give you answers.
On Wed, 7 Dec 2005 11:08:57 +0200, "x" <x_at_not-exists.org> wrote:
>
>"Rick Elbers" <rick.elbers_at_chello.nl> wrote in message
>news:3189p1dlv9qpofqai5nq8v32keao7amiph_at_4ax.com...
>> Dear database experts,
>
>> Can somebody enumerate the problems with an updatable view for me ?
>> With an updatebleview:= joined set of related tables and relations
>> from which rows can be updated, inserted and deleted like you
>> can in a simple table or master-detail relation.
>
>What is an updatable view in your view ?
Defined that above. See above
>What do you mean by joined set of related tables and relations ?
A list of tables which are joined( flattened if you want) on their related identifiers( keys if you want). In fact your regular join
>Maybe you mean just a set of tables ?
Yes, I think so
>What do you mean by related ?
With a foreign key-primary key relation
>There is any constraint definition ?
Could be. Couldnt be. Should both be possible
>Who is enforcing the constraints ? The DBMS or the application ?
the DBMS.
>Who is doing the translation of the update requests ? The application or the
>DBMS ?
Thats the point. As much as possible the class UpdatableView.
>How you deal with the errors ?
That too is responsibility of UpdatableView
>Are we talking about SQL DBMS or something else ?
Yes we are talking about sql server to be precise( although I doubt it matters)
Etc etc trivial answers
>
>> My first try is to find hierarchy in de database by finding the
>> absolute parents assigning them level 0. Parents of my table are
>> considered those relations in which my foreign key doesnt allow
>> DBNull.
>
>What if do not find any parent this way ?
Then you are safe to insert/update anything in that table
>And what is the purpose of building the hierarchy ?
See above. Do you really understand the problem or not ?
>
>> Then from there on proceed to give every table that has no parents but
>> level 0 parents a level 1 etc.
>>
>> Problems seem to be autojoins and multiple relations between tables.
>> Those problem can be solved to use every table only once in the scan.
>>
>> So the first question is: will this way of hierarchising the
>> relational db always valid ?
>
>> Then secondly given the hierarchy what problems remain when we talk
>> about insert/update/delete and all kinds of combinations of those ?
>
>Gee! Let me think. The problems are ... what is the problem again ?
>
Funny guy. The problem is the database. How to get rid of its messing with good OO code.
>> Regards and tx for answering,
>>
>> Rick Elbers
>>
>>
>>
>>
>>
>
Rick Received on Wed Dec 07 2005 - 21:48:17 CET