Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Gurus, Can Fox Update views that are UNIONed???
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00653315
Message ID:
00653466
Views:
19
>Can Fox Update views that are UNIONed???
>If so, how?
>
>Thanks!!!!

It depends on a number of factors.

1. Did you union queries from different tables or did you simply need two different filter expressions for the same table?
2. Did you concatenate the field lists of both tables (each field from both tables is unique in the result set) or did you use the same field names for different fields (table1.field1 and table2.field2 combine into resultset.field3)?

Take the following example:
Table 1
Field1         Field2
1              John
2              Joe
3              Jim

Table2
Field1         Field2
1              Baseball
2              Tennis
3              Croquet

Result Set 1
select t1.field1, t1.field2, 0 as field3, space(8) as field4
   from table1 t1
union
select 0 as field1, space(8) as field2, t2.field1 as field3, t2.field2 as field4 
   from table1 t2

Field1       Field2         Field3         Field4
1            John           0
2            Joe            0
3            Jim            0
0                           1              Baseball
0                           2              Tennis
0                           3              Croquet

Result Set 2
select t1.field1, t1.field2
   from table1 t1
union
select t2.field1, t2.field2 
   from table1 t2

Field1       Field2
1            John
2            Joe
3            Jim
1            Baseball
2            Tennis
3            Croquet
Changes in result set 1 can be sent to the backend. Field1 and Field3 would need to be configured as key values. Changes in result set 2 can not. There is no way of telliong which table each row comes from.

If you post your union statement, a more definitive answer may be available.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform