Send feedback on this topic.
Teradata.Client.Provider
SchemaLoader Utility -- Loading the Mapped Tables
.NET Data Provider for Teradata > Developer's Guide > ADO.NET Entity Provider for Teradata > Entity Provider Store Schemas > Mapping Views and ViewColumns to Tables > SchemaLoader Utility -- Loading the Mapped Tables
.NET CORE   This feature is not supported by the .NET Core implementation of the Data Provider.

The SchemaLoader.exe utility is located in the bin directory of the Teradata Provider installation. This utility is used to load the information into the tables that are mapped to the Views and ViewColumns store schemas.

The primary purpose of this utility is to pre-process the information related to the ViewColumns store schema. As previously mentioned in The Views and ViewColumns Problem Overview the information for ViewColumns cannot be retrieved from the Teradata Data Dictionary. The data needs to be pre-processed before it is returned. The SchemaLoader will pre-process the information, and then load the table mapped to ViewColumns with the information required by this store schema.

Command Line Options

The SchemaLoader.exe has the following command line options:

Option Description
/s

Required.

The connection string. There are several connection string attributes that affect the behavior of the SchemaLoader when it is processing the information that will be loaded into the tables. The following attributes have the following affect on the behavior of the SchemaLoader:

Attribute Behavior
Database

The default database. Indicates the database where the tables will be created. If this attribute is not specified, the value specified for the UserId is used as the default database.

If ANSI session mode is going to used, it is highly recommended that a value is specified for this attribute and the case of the database name be the same as what was specified when the database was created. Refer to the SessionMode attribute for more information.

UseXViews Indicates whether the information for the store schema will be retrieved from the X version of the Teradata Data Dictionary objects or from the non-X objects.
RestrictToDefaultDatabase The information retrieved for the store schemas will be limited to the objects that are contained in the Default Database.
SessionMode

If the Session Mode is not specified, the Default is used. If the default session mode on the Advanced SQL Engine is ANSI or ANSI has been specified as the value to the attribute, strings will be case sensitive in comparisons.

A problem occurs when RestrictToDefaultDatabase is set to true and the session mode is ANSI. The SchemaLoader will use the value specified for the Database attribute and retrieve information on views and their columns contained in the default database. No rows will be returned if the database name does not have the same case as the database name contained in the Teradata Data Dictionary.

Another problem occurs when a value has not been specified for the Database attribute, RestrictToDefaultDatabase is true, and the SessionMode is ANSI. Since a default database has not been specified, the data provider will retrieve it from the SQL Engine. The value that is retrieved will be the same as the UserId, however, it will be all in upper case. Again, no rows will be returned if the casing does not match the database name contained in the Teradata Data Dictionary.

/c

Required.

The name of the table that is to be mapped to the ViewColumns store schema.

/v

Required.

The name of the table that is to be mapped to the Views store schema.

/d

Optional.

If the tables specified in the arguments for the /c and /v exist, they will be deleted.

The SchemaLoader will not automatically drop the tables if they already exist. This option must be specified to indicate to the SchemaLoader that the tables are to be dropped if they exist. If this option has not been specified and any of the tables exist, the SchemaLoader will display an error message on the console and exit.

Examples Using the SchemaLoader

  1. The table ViewTable corresponds to the Views store schema, and ViewCol corresponds to ViewColumns. If the tables exist they will be deleted. The non-X version of the Teradata Data Dictionary views will be used, and the information for the Views and ViewColumns store schema will not be restricted to the default database.

    SchemaLoader /d /v "ViewTable" /c "ViewCol" /s "DataSource=teradata1;UserId=terauser;Password=terapass;Database=TeraUser;RestrictToDefaultDatabase=false;"

  2. The X version of the Teradata Data Dictionary views will be used and the information for the store schemas will be restricted to the default database.

    SchemaLoader /s "DataSource=teradata1;UserId=terauser;Password=terapass;Database=StoreSchemaInfo;RestrictToDefaultDatabase=true;UseXViews=true" /v "SchemaViews" /c "SchemaViewColumns" /d