Manage Physical Views
| This feature is available only in Enterprise Edition. |
Manage physical views in script by using the :physicalmodel or equivalent :pm command. See Create a Physical View for information about physical views in the User Portal.
Optional parameters should be provided in a key-value pair with a preceding double-hyphen (--). For example: --organizationid organization0.
|
List Available Physical Views
The list-models action lists the available physical views. Note: You must first connect to a repository. See Connect to a Repository.
Parameters
- datasource
-
Data source for which to list views (optional)
- physicalmodel
-
Physical view for which to list extended physical views (optional)
- organizationid
-
Organization ID for multi-tenant environment. (See Enable Multi-Tenancy.) (optional)
Examples
// List all physical views in environment
:pm list-models
// List all physical views in organization1
:pm list-models --organizationid organization1
// List extended views for physical view pv_org1 in organization1
:pm list-models --physicalmodel=pv_org1 --organizationid organization1
// List physical views for data source ModelTest
:pm list-models --datasource=Examples/ModelTest
Rename Physical View
The rename-model action renames a physical view. Note: You must first connect to a repository. See Connect to a Repository.
Parameters
- datasource
-
Data source on which physical view is defined
- oldname
-
Name of physical view
- newname
-
New name of physical view
- folder
-
Folder to contain physical view (optional)
- description
-
Description for physical view (optional)
- organizationid
-
Organization ID for multi-tenant environment. (See Enable Multi-Tenancy.) (optional)
Create Physical View
The create-model action creates a physical view. Note: You must first connect to a repository. See Connect to a Repository.
Parameters
- datasource
-
Data source on which new physical view should be defined
- name
-
Name of physical view
- parentModel
-
Name of physical view that is being extended (optional).
- folder
-
Folder to contain physical view (optional)
- description
-
Description for physical view (optional)
- connection
-
Connection for multi-tenant environment. (See Enable Multi-Tenancy.) (optional)
- organizationid
-
Organization ID for multi-tenant environment. (See Enable Multi-Tenancy.) (optional)
Remove Physical View
The remove-model action deletes a physical view. Note: You must first connect to a repository. See Connect to a Repository.
Parameters
- datasource
-
Data source on which physical view is defined
- name
-
Name of physical view
- folder
-
Folder containing physical view (optional)
- parentModel
-
Name of base physical view for extended physical view. (optional)
- organizationid
-
Organization ID for multi-tenant environment. (See Enable Multi-Tenancy.) (optional)
Open Physical View
The open-model action opens a physical view for editing. Note: You must first connect to a repository. See Connect to a Repository.
Parameters
- datasource
-
Data source on which physical view is defined
- name
-
Name of physical view
- parentModel
-
Name of base physical view for extended physical view. (optional)
- organizationid
-
Organization ID for multi-tenant environment. (See Enable Multi-Tenancy.) (optional)
Examples
// Open base physical view OrderView
:pm open-model "Examples/Orders" "OrderView"
// Open extended physical view associated with Default Connection having parent Order View for organization1
:pm open-model 'Examples/Orders' '(Default Connection)' --parentModel 'Order View' --organizationid organization1
Get Physical View
The get-model action returns a handle to the physical view. Note: You must first connect to a repository. See Connect to a Repository.
Save Physical View
The save-model action save a physical view. Note: You must first connect to a repository. See Connect to a Repository.
Close Physical View
The close-model action closes a physical view. Note: You must first connect to a repository. See Connect to a Repository.
Add Table to Physical View
The add-table action adds a new table to the physical view. Note: You must first connect to a repository. See Connect to a Repository.
Remove Table from Physical View
The remove-table action removes a table from the physical view. Note: You must first connect to a repository. See Connect to a Repository.
Create Inline View
The create-view action creates an inline view from provided SQL. Note: You must first connect to a repository. See Connect to a Repository.
Create Join
The create-join action creates a join between tables in the physical view. Note: You must first connect to a repository. See Connect to a Repository.
Examples
import inetsoft.shell.dsl.PhysicalTableDelegate
def join1 = PhysicalTableDelegate.join {
type 'EQUAL'
orderPriority 1
merge 'AND'
cardinality 'MANY_TO_ONE'
weak false
column 'CUSTOMER_ID'
foreignTable 'SA.CUSTOMERS'
foreignColumn 'CUSTOMER_ID'
cycle false
base false
}
:pm create-join id cview1 join1
Remove Join
The remove-join action deletes a join. Note: You must first connect to a repository. See Connect to a Repository.
Create an Alias Table
The create-alias action creates an alias table. See Alias a Single Table for information about the role of aliases in a physical view. Note: You must first connect to a repository. See Connect to a Repository.
Rename an Alias Table
The rename-alias action renames an alias table. See Alias a Single Table for information about the role of aliases in a physical view. Note: You must first connect to a repository. See Connect to a Repository.
Update Auto-Alias Properties
The update-auto-aliasing action changes properties of auto-alias tables. See Alias a Single Table for information about the role of aliases in a physical view. Note: You must first connect to a repository. See Connect to a Repository.
List Tables
The list-tables action lists tables of an extended physical view. See Extend a Physical View for more information about extended physical views. Note: You must first connect to a repository. See Connect to a Repository.
Parameters
- datasource
-
Datasource name for which to list tables
- connection
-
Connection for multi-tenant environment. (See Enable Multi-Tenancy) (optional)
- catalog
-
Database catalog (optional)
- schema
-
Database schema (optional)
- name
-
The name of the table to match (optional)
- organizationid
-
Organization ID (optional)
Examples
// List tables for Orders datasource for organization0
:pm list-tables --datasource=Examples/Orders --organizationid organization0
// List tables for ModelTest datasourse, schema SA
:pm list-tables "Examples/ModelTest" "" "" "SA" "CUSTOMERS"
// List extended physical view tables
:pm list-tables "mv1" "mv2"
List Table Column
The list-columns action lists the columns of specified tables Note: You must first connect to a repository. See Connect to a Repository.