Metadata Procedures
You are looking at an older version of the documentation. The latest version is found here.
SYSADMIN.getGeneratedColumnNames
This procedure exposes column name generation as we do for materialized tables.
SYSADMIN.getGeneratedColumnNames(IN sourceDs string NOT NULL, IN sourceTableOrProc string NOT NULL, IN targetDs string NOT NULL)
RETURNS (position integer NOT NULL, "origName" string NOT NULL, "name" string NOT NULL, "dvType" string NOT NULL, "targetType" string NOT NULL)
Parameters:
Parameter | Description |
---|---|
sourceDs | Source data source name |
sourceTableOrProc | Source table, view, or procedure name |
targetDs | Target data source name |
Resultset columns:
Column | Description |
---|---|
position | Column position (1..n) |
origName | Original canonical (upper case) column name |
name | Destination column name, renamed if needed |
dvType | DV column type |
targetType | Native column type for the target data source, can be used for comparison |
SYSADMIN.setColumnStats
Set statistics for the given column.
SYSADMIN.setColumnStats(IN tableName string NOT NULL, IN columnName string NOT NULL, IN distinctCount long, IN nullCount long cardinality, IN max string, IN min string)
All statistics values are nullable. Passing a null stat value will leave the corresponding metadata value unchanged.
SYSADMIN.setProperty
This procedure sets an extension metadata property for the given record. Extension metadata is typically used by translators.
SYSADMIN.setProperty(OUT OldValue clob(2097152) NOT NULL RESULT, IN UID string(50) NOT NULL, IN Name string NOT NULL, IN "Value" clob(2097152))
Setting a value to NULL
will remove the property.
Here is an example in which the property 'some name' is set to 'some value' on the table tab:
CALL SYSADMIN.setProperty(uid => (SELECT uid FROM SYS.TABLES WHERE name = 'tab'), name => 'some name', value => 'some value');;
Please note that use of this procedure will not trigger the replanning of associated prepared plans.
SYSADMIN.translateColumnName
This helper procedure translates column names from a source table to names which will be created for destination DBMS in a materialized table. One column may be passed as a string, but multiple columns should be passed as an array of strings. It is used in the historyUpdate()
, upsert()
, and batchUpdate()
procedures.
SYSADMIN.translateColumnName(IN sourceSchema string NOT NULL, IN sourceTable string NOT NULL, IN destSchema string NOT NULL, IN columns object NOT NULL, OUT translatedColumns object NOT NULL RESULT)
SYSADMIN.translateColumnExpr
This procedure does almost the same as translateColumnName
above, but the columns are replaced within an expression. It can be used in the historyUpdate
, upsert
and batchUpdate
procedures.
SYSADMIN.translateColumnExpr(IN sourceSchema string NOT NULL, IN sourceTable string NOT NULL, IN destSchema string NOT NULL, IN expr string NOT NULL, OUT translatedExpr string NOT NULL RESULT)
SYSADMIN.getTypeOfResource
This procedure returns the type of the resource which can be one of the following:
TABLE
VIEW
PROCEDURE
COLUMN
UNDEFINED
SYSADMIN.getTypeOfResource(IN name string NOT NULL)
RETURNS ("type" string NOT NULL)
name
is the name of the resource: "model.[view/table.column]".