User Guide > Views and Table Resources > Generating a Model from the SQL Panel
 
Generating a Model from the SQL Panel
If you have typed or changed the SQL statement in the SQL panel, you can generate a model based on the SQL currently displayed in that panel. The Model and Grid panels reappear in the view editor when you generate a model.
The model generator does not support all of TDV SQL syntax. SQL features the model generator does not support are as follows:
UNION, INTERSECT, EXCEPT, EXISTS, scalar subqueries, derived tables, IN clause with a subquery, quantified subquery, and the INSERT, UPDATE, and DELETE operations.
Error messages result for models generated from queries that include these SQL features.
In the regenerated model, the tables would be joined at the top (joining the table tiles), instead of at the appropriate columns, under the following circumstances:
If the ON clause of the JOIN has one or more of the following items:
A function
an OR condition
Any of the following predicates: IN, LIKE, BETWEEN, IS NULL
If the join is a self-join and no columns are involved in the join, or only columns from the same table are involved in the join.
The model generator accepts all INNER and OUTER JOINs. However, it might not be able to match the columns originating from the left and right sides of the join. When the model generator cannot identify both columns, the two tables in the resulting model are joined by a line that stretches from the title bar of the first table to the title bar of the second table.
To generate a model from the SQL panel
1. Click the Generate Model toolbar button in the view editor’s SQL panel.
Note: If Studio generated the SQL, the Generate Model toolbar button is not available.