Thanks to all who replied.

1- Mike, The view does have primary keys. One per table. It also knows how they 
join. I figured on tableupdate it would 'know' how to preserve the linkage.

2- I never got Dave Crozier's reply. Weird. 

3- Dave, I do set quite a few DBSetProp()s. Didn't want to burden people with a 
big chunk but I could post the REAL view definition, along with the settings 
that follow it. You say the word  ;-)

4- Do other people agree with Mike's advice to avoid relying on native 
behaviour to update multiple tables from one view?

5- Stephen, I hear you re: not using AutoInc. Too late in the game for me AND 
it has been very good for me otherwise.

Thanks again...

Henry


-----Original Message-----
From: profoxtech-boun...@leafe.com [mailto:profoxtech-boun...@leafe.com] On 
Behalf Of MB Software Solutions,LLC
Sent: April 23, 2010 12:51 AM
To: profoxt...@leafe.com
Subject: Re: Updatable local view with multiple tables

henry.dag...@hrsdc-rhdcc.gc.ca wrote:
> I just realized that I never before used updatable views where more than one 
> table needed to be updated. I now see that the joinable fields do not get 
> automatically filled (to maintain the JOIN).
> 
> In the example below, I need to update all fields except 3: The two PKs (they 
> are AutoInc) and HsgUnit.fk_address (I won't know the value until 
> Address.pk_address gets auto-filled when a record is added to Address).
> 
> SELECT Address.pk_address, (some ADDRESS fields), ;
>        Hsgunit.pk_hsgunit, Hsgunit.fk_address, (some HSGUNIT fields) ;  
> FROM LOCVIEW!ADDRESS ; INNER JOIN LOCVIEW!HSGUNIT ON  
> Address.pk_address = Hsgunit.fk_address
> 
> Considering that the view is JOINed by the pk_adress-fk_address, I would have 
> expected HsgUnit.fk_address to get populated on save.
> 
> What am I missing?
> 
> Thx
> 
> Henry


Try to avoid using a single view to update multiple tables via the native view 
means.  The problem comes with the primary keys....if the view doesn't have a 
primary key for a table, how will it know which
record(s) to update?  You might have to resort to using explicit code to do the 
updates.

-- 
Mike Babcock, MCP
MB Software Solutions, LLC
President, Chief Software Architect
http://mbsoftwaresolutions.com
http://fabmate.com
http://twitter.com/mbabcock16


_______________________________________________
Post Messages to: ProFox@leafe.com
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/ac8e1658bfca0b4f8661f250d64b7bedb02...@nhev304.hrdc-drhc.net
** 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