Skip to main content
Skip table of contents

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.

SQL
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:

ParameterDescription
sourceDsSource data source name
sourceTableOrProcSource table, view, or procedure name
targetDsTarget data source name

Resultset columns:

ColumnDescription
positionColumn position (1..n)
origNameOriginal canonical (upper case) column name
nameDestination column name, renamed if needed
dvTypeDV column type
targetType

Native column type for the target data source, can be used for comparison

SYSADMIN.setColumnStats

Set statistics for the given column.

SQL
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.

SQL
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:

SQL
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.

SQL
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.

SQL
 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
SQL
SYSADMIN.getTypeOfResource(IN name string NOT NULL) 
 RETURNS ("type" string NOT NULL)

name  is the name of the resource: "model.[view/table.column]".

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.