Saving Data to Views
To save changes to a view, specify the target view using INSERT, UPDATE, and DELETE objects.
Example: xls.objects Table
Here’s a sample from the xls.objects table:
ID | TABLE_SCHEMA | TABLE_NAME | TABLE_TYPE | TABLE_CODE | INSERT_OBJECT | UPDATE_OBJECT | DELETE_OBJECT |
---|---|---|---|---|---|---|---|
s02 | view_cashbook | VIEW | s02.view_cashbook | s02.view_cashbook | s02.view_cashbook | ||
s02 | usp_cashbook | PROCEDURE | s02.view_cashbook | s02.view_cashbook | s02.view_cashbook | ||
s02 | code_cashbook | CODE | <SQL> | s02.view_cashbook | s02.view_cashbook | s02.view_cashbook |
Example: QueryList View
Here’s a sample from the QueryList view:
ID | TABLE_SCHEMA | TABLE_NAME | TABLE_TYPE | TABLE_CODE | INSERT_PROCEDURE | UPDATE_PROCEDURE | DELETE_PROCEDURE | PROCEDURE_TYPE |
---|---|---|---|---|---|---|---|---|
s02 | view_cashbook | VIEW | s02.view_cashbook | s02.view_cashbook | s02.view_cashbook | |||
s02 | usp_cashbook | PROCEDURE | s02.view_cashbook | s02.view_cashbook | s02.view_cashbook | |||
s02 | code_cashbook | CODE | <SQL> | s02.view_cashbook | s02.view_cashbook | s02.view_cashbook |
Tools like SaveToDB 8+, DBEdit, DBGate, and ODataDB automatically create these configurations if the target view is detected and is updatable.
For instance, if a user has the VIEW DEFINITION permission and a view or stored procedure contains code like SELECT * FROM s02.view_cashbook
, the system can identify the target view.
Keep in mind that target views must be updatable and contain primary key or identity columns.
Implementation Details
SaveToDB and DBEdit generate and execute INSERT, UPDATE, and DELETE commands automatically.
DBGate executes INSERT, UPDATE, and DELETE commands on the server-side based on POST, PUT, and DELETE requests.
ODataDB creates EntitySets for views and FunctionImports for stored procedures and SQL codes targeting the appropriate EntitySet.