Hello Bob,
If the common column in between the subordinate tables and the driving
view is named: ID you MUST
create your view listing all the column and assigning an alias for each
the most important alias will be for column ID since is will be used by
the form to determine what columns will be display for the second table
on the form. RBase forms REQUIRED the name of the column between the
main driving table and all other tables to BE THE SAME. RBase creates
the link occurs automatically when the column name matches. When you
use a view with correlation, the generated column names are lost t1.ID
ect....
This is way everyone keeps telling you to use ALIAS.
Something like this::
CREATE TEMP VIEW STUDS2 (ID,CatCode,LastName,FirstName) +
AS SEL T1.ID, T1.CATCODE, +
T2.LASTNAME, T2.FIRSTNAME FRO STUDENTS T1
LEFT OUTER JOIN ROOMS T2 ON T1.ID = T2.ID
Good Luck,
Manuel
Bob Powell wrote:
> Hello all:
>
> Not long ago I posted a question about using a view as the
> driving (table) in a form and then having other tables used
> in the form subordinate to it. I continue to have problems
> with the subordinate tables containing all rows. Not just
> the rows that match the ID in the driving view. It may or
> may not be important but the view I am attempting to use in
> the form is created via an outer join as well. (Code
> below).
>
> I found these guidlines in the R:BASE 5.5 users's manual
> page 3-40.
>
> 1. Forms based on single-table views can be used to
> insert, delete, update, and view data. Forms based on
> multi-table views can only be used to update or view data.
>
> 2. You can build a form that is associated with both views
> and tables.
>
> 3. Views cannot be updated in a form if they were created
> using the GROUP BY ord ORDER BY commands or the UNION
> operator.
>
> 4. You can use a view in forms with other tables or views
> only if aliases are used for column names. You can use
> aliases in Query By Example, or with the CREATE VIEW
> command using the collist option.
>
> The code I'm using to create these entities are as follows:
>
> CREATE TEMP VIEW STUDENTS AS SEL T1.ID, T1.CATCODE, +
> T2.LASTNAME, T2.FIRSTNAME FOR CATEGORY T1, NAMES T2 +
> WHE T1.ID = T2.ID AND CATCODE = 6
>
> Then I create the view I use as the driving (table) for the
> form.
>
> CREATE TEMP VIEW STUDS2 AS SEL T1.*, T2.* FRO STUDENTS T1
> LEFT OUTER JOIN ROOMS T2 ON T1.ID = T2.ID.
>
> The resulting STUDS2 view contains everything I need. I
> just can't get the form subordinate tables to display only
> for the current ID.
>
> Currently I'm using a temp table projected from the STUDS2
> view attaching a form to that. It works but I prefer to
> use the information from the view without projecting a temp
> table. I think this should work. Anyone got an ideas?
> Thanks in advance.
>
> ----------------------
> Bob Powell
> The Hotchkiss School
> Lakeville, Connecticut
> Systems Administrator
> [EMAIL PROTECTED]