Updated on 2025-12-11 GMT+08:00

Teradata Perl Migration

Teradata Perl parameters are used to configure rules for Teradata Perl script migration.

Open the perl-migration.properties file in the config folder and set parameters in Table 1 as required.

  • Parameter values are case-insensitive.
  • The values of db-bteq-tag-name and db-tdsql-tag-name in the following table can be changed.
Table 1 Table 1 Parameters in the perl-migration.properties file

Parameter

Description

Value Range

Default Value

Example

  • db-bteq-tag-name

Scripts to be processed in Perl files.

BTEQ: Only the scripts under the BTEQ tag are processed.

  • bteq

bteq

db-bteq-tag-name=bteq

  • db-tdsql-tag-name

Scripts to be processed.

SQL_LANG: Only the scripts under the SQL_LANG tag are processed.

sql_lang

sql_lang

db-tdsql-tag-name=sql_lang

  • add-timing-on

Whether to enable the insertion of scripts to calculate execution time.

If it is enabled, the add timing script will be added to each input file.

  • true
  • false

false

add-timing-on=true

  • remove-intermediate-files

Whether to delete the intermediate SQL file generated by the DSC after the migration is complete.

The intermediate files contain the BTEQ and SQL_LANG syntax in SQL files. These files are used as input for DSC.

true: The intermediate files are deleted.

false: The intermediate files are not deleted.

  • true
  • false

true

remove-intermediate-files=true

  • migrate-variables

Whether to migrate SQL commands assigned to Perl variables.

Perl files can contain Perl variables with SQL statements. These variables are executed by using the PREPARE and EXECUTE statement in Perl. DSC can extract SQL commands from Perl variables and migrate them.

true: SQL commands assigned to Perl variables are migrated.

false: The Perl variables with SQL commands are skipped during migration.

Example 1:

(The parameter is true) Input:

1
$V_SQL = "CT X1(C1 INT,C2 CHAR(30))";

Output:

1
CREATE TABLE X1(C1 INT,C2 CHAR(30));

Example 2:

Input

1
$onesql ="SELECT trim(tablename) from dbc.tables                   WHERE databasename = '${AUTO_DQDB}' and tablename like 'V_%'             order by 1;";   $sth_rundq = $dbh->execute_query($onesql);

Output

1
  $onesql ="SELECT           TRIM( tablename )      FROM           dbc.tables      WHERE           databasename = '${AUTO_DQDB}'           AND tablename LIKE 'V_%'      ORDER BY           1 ;  ";   $sth_rundq = $dbh->execute_query($onesql);
  • true
  • false

true

migrate-variables=true

  • logging-level

Level of Perl migration logs.

error: Only errors are logged.

warning: Errors and warnings are logged.

info: Errors, warnings, and information are logged. This level contains all information.

  • error
  • warning
  • info

info

logging-level=info

  • log-file-count

Maximum number of log files that can be retained, including the log files in use and archived log files.

If the number of log files exceeds the upper limit, the earliest files will be deleted until the new log files are successfully archived.

3 - 10

5

log-file-count=10

  • log-file-size

Maximum file size.

Upon reaching the specified size, a file is archived by adding a timestamp to the file name.

Example:

1
perlDSC_2018-07-08_16_12_08.log

       

After the archiving, a new log file perlDSC.log with a timestamp is generated.

1MB - 10MB

5MB

log-file-size=10MB

  • migrate-executequery

Whether to migrate execute_query that contains SQL content.

true: The query is migrated.

false: The query is not migrated.

Example:

(This parameter is true) Input:

1
my $rows1=$conn1->execute_query("sel ${selectclause} from ${databasename}.${tablename};          ");

Output:

1
my $rows1=$conn1->execute_query("SELECT           ${selectclause}      FROM           ${databasename}.${tablename} ;");
  • true
  • false

true

migrate-executequery =true