15.00 - ReplaceExportDefinition - Teradata Database

Teradata Database SQL Functions, Operators, Expressions, and Predicates

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1145-015K
Language
English (United States)

ReplaceExportDefinition

Purpose  

Creates or modifies a user-defined export width definition.

Syntax  

where:

 

Syntax element …

Specifies …

SYSLIB

the name of the database where the stored procedure is located.

export_definition_name

a user-defined export definition name.

You cannot specify 'Expected', 'Compatibility', or 'Maximum'.

export_width_rule_set

a user-defined BYTE string of 40 hexadecimal digits used to define the export width rules associated with export_definition_name.

result_message

the output message of the stored procedure.

Authorization

You must have EXECUTE privileges on the stored procedure or on the SYSLIB database.

Argument Types

Expressions passed to this procedure must have the following data types:

  • export_definition_name = VARCHAR(n) CHARACTER SET LATIN, where the maximum value for n is 30.
  • export_width_rule_set = BYTE(20)
  • result_message = VARCHAR(310) CHARACTER SET UNICODE
  • You can also pass arguments with data types that can be converted to the above types using Teradata Database implicit data type conversion rules.

    Usage Notes

    To create a new user-defined export width definition, call the ReplaceExportDefinition stored procedure with the following arguments:

  • export_definition_name is a LATIN character string that specifies the name of the new export width definition.
  • export_width_rule_set is a BYTE string of 40 hexadecimal digits, which encode the export width rules for the new export width definition. For details about the export width rules, see “Export Width Rules” on page 886.
  • result_message is an output parameter that contains the output message of the stored procedure.
  • ReplaceExportDefinition creates the new export width definition with the specified rules and updates the DBC.ExportWidth table.

    To modify the export width rules for an existing user-defined export width definition, call the ReplaceExportDefinition stored procedure with the following arguments:

  • export_definition_name is a LATIN character string that specifies the name of an existing user-defined export width definition that you want to modify.
  • export_width_rule_set is a BYTE string of 40 hexadecimal digits, which define the new export width rules for export_definition_name. For details about the export width rules, see “Export Width Rules” on page 886.
  • result_message is an output parameter that contains the output message of the stored procedure.
  • ReplaceExportDefinition modifies the specified export width definition with the new rules and updates the DBC.ExportWidth table. The revised export width definition takes effect at the next transaction for each affected user. In process transactions continue with the existing export width definition.

    Note: You cannot specify 'Expected', 'Compatibility', or 'Maximum' for export_definition_name.

    Export Width Rules

    export_width_rule_set is a BYTE string of 40 hexadecimal digits with the following format:

  • The 1st ten digits define the export width for LATIN strings.
  • The 2nd ten digits define the export width for UNICODE strings.
  • The 3rd ten digits define the export width for KANJISJIS strings.
  • The 4th ten digits define the export width for GRAPHIC strings.
  • For example, if export_width_rule_set is '1112211111222232222211121111112222322222'XB, then:

  • The 1st ten digits (1112211111) define the export width for LATIN strings.
  • The 2nd ten digits (2222322222) define the export width for UNICODE strings.
  • The 3rd ten digits (1112111111) define the export width for KANJISJIS strings.
  • The 4th ten digits (2222322222) define the export width for GRAPHIC strings.
  • Each position in a set of 10 digits specify the export width conversion multiplier for a session character set:

     

    This position in a set of 10 digits...

    Is the conversion multiplier for....

    1st

  • any session character set that ends in the string '_0I'.
  • the session character set 'KATAKANAEBCDIC'.
  • 2nd

    any session character set that ends in the string '_0U'.

    3rd

    any session character set that ends in the string '_0S'.

    4th

    the session character set 'UTF16'.

    5th

    the session character set 'UTF8'.

    6th

    any site‑defined session character set with STATEMACHINE EUC1211.

    7th

    any site‑defined session character set with STATEMACHINE EUC1223.

    8th

    any site‑defined session character set with STATEMACHINE S80.

    9th

    any site‑defined session character set with STATEMACHINE S80A1E0.

    10th

    any site‑defined session character set with STATEMACHINE SOSI0E0F.

    Each position can have a value of 1, 2, 3, or 4, except the 4th position in each 10 character set (UTF16), which must have a value of either 2 or 4.

    For example, if export_width_rule_set is '1112211111222232222211121111112222322222'XB:

  • When exporting from the LATIN server character set (1st set of 10 digits, 1112211111), for the UTF8 session character set (the 5th position in the 1st set of 10 digits), the export width is 2.
  • When exporting from the UNICODE server character set (2nd set of 10 digits, 2222322222), for the UTF8 session character set (the 5th position in the 2nd set of 10 digits), the export width is 3.
  • When exporting from the KANJISJIS server character set (3rd set of 10 digits, 1112111111), for the UTF16 session character set (the 4th position in the 3rd set of 10 digits), the export width is 2.
  • Example  

    In this example, if MyExportWidth does not exist, ReplaceExportDefinition creates a new export width definition named MyExportWidth with an associated export width rule set of '1422323221332232322321123111122322323221'XB. If MyExportWidth already exists, then ReplaceExportDefinition replaces the current export width rule set of MyExportWidth with the new export width rule set of '1422323221332232322321123111122322323221'XB.

    CALL SYSLIB.ReplaceExportDefinition
    ('MyExportWidth','1422323221332232322321123111122322323221'xb,msg);