General information
Category:
The Mere Mortals Framework
In the following SQL statement used for a view, both tables “CONTRACTS” and “TITLES” have a common field “CONTRACTNO”.
CREATE SQL VIEW lv_contview AS ;
SELECT Contracts.*, Titles.titleno, Titles.itemno, Titles.authorno,;
Titles.titlename, Titles.paythis, Titles.perc_used, Titles.dateroypai,;
Titles.itemname, Titles.tnotes, Authors.authorname,;
contracts.contractno+titles.titleno+titles.itemno as titno ;
FROM contapp!contracts INNER JOIN contapp!titles;
INNER JOIN contapp!authors ;
ON Titles.authorno = Authors.authorno ;
ON Contracts.contractno = Titles.contractno;
ORDER BY Contracts.contractno
In the Select part of the statement “Contracts.*” ensures that the term “Contractno” is in the result set. If I also added “Titles.Contractno” to the Select section, the result set includes “Contractno_a” and “Contractno_b”, or something similar, in the result set. Thus I omit “Titles.Contractno”, as it has caused me code problems in the past. It seems to work fine, but I am worried about updates. I need to know:
1. Is my thinking correct on duplicate field names? If not, what is the correct syntax for the SQL statement?
2. If the common field is changed, are both tables updated with the change?
3. Are all tables, when combined in a primary business object by an SQL statement in one view updated successfully if the field “DBSETPROP” lines in “VIEWS.PRG” define update .T.?
Thanks Allan Godney.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only