On 8/9/07, Mark Stanton <[EMAIL PROTECTED]> wrote:

> That sounds a bit like "it's the way it is because it's the way it is".

Well, you tell me how to do it:

You have a view which is SELECT Customer.Name, State.Name from
Customer JOIN StateNames on Customer.iStateFK = State.iStatePK.

You change the Customer name from "Acme" to "Apex" and the State name
from "Arkansas" to "Alaska" and you say "Save."

I know I'm changing the Customer name, but am I changing the name of
the state of Arkansas to Alaska? or am I changing the FK it points at?
Or am I changing all records that point to Arkansas to point to
Alaska? Or did you mean something else? When you update more than one
table in a single view, the command is ambiguous and the results
unpredictable. That's the way it is. (There are probably better
examples, but this was off the cuff).

SQL and relational theory deal with updating one table per statement,
with the caveat that triggers can trigger further single-table
changes. It makes for a consistent syntax that has
mathematically-provable rules in some obscure academic discipline.

It's like something being in two places at once. You can't do that.
"Because I said so, that's why."

> Why don't my view do that (update the tables of which it's composed
> individually, wrapped up in a transaction), since, as you point out, the
> solution is relatively simple and mechanical?

That's not at all what I meant to say.

> Why offer a solution and then make me do half the work?

So that you can express your intention of what you expect the view do
do. It isn't as simple as you're making it out to be. "Save" is fairly
trivial, but what about "Delete" -- should that delete all the lookup
values as well? Should deleting an order delete all the order items?
How about the inventory items? The sales people?


-- 
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to