User Guide > Views and Table Resources > Designing a View and Table Resource > Designing SQL for a View in the SQL Panel
 
Designing SQL for a View in the SQL Panel
You can use the SQL panel in the view editor to type and edit a view’s SQL. You can upload an existing SQL statement to use as a starting point using the Insert from File button.
Note: When you edit the SQL in the SQL panel, the design in the Model panel becomes invalid and the Model and Grid panels disappear. You can regenerate the model to redisplay the Model and Grid panels as described in Generating a Model from the SQL Panel.
There are some limitations and considerations when editing the SQL:
The SQL for a view cannot contain an INSERT, UPDATE, or DELETE clause. You have to include such clauses in a SQL script, as described in Procedures
If you want to use the Model panel later for the current view, first save the SQL statement under a different name, and then use the SQL panel for your hand-typed SQL code.
You are responsible for the syntax of the SQL you type in the SQL panel. Studio does not check the validity of the syntax.
If table or column names contain special characters, such as @, $, or &, enclose the names in double quotation marks (" ") in the query.
You should not use OFFSET and FETCH in a composite view.
For details on the SQL features supported in TDV, see the TDV Reference Guide.
To create or edit a view’s SQL in the SQL panel
1. Click the SQL tab in the view editor.
2. Type the SQL code for your view.
You can do most standard editing tasks in the SQL panel. For a list of keyboard shortcuts, see Studio Code Editing Keyboard Shortcuts.
3. Save the view.
Note: You can also save the current SQL using the Save to File button.