Teradata Perl Configuration
Teradata Perl parameters are used to customize rules for Teradata Perl script migration.
Open the perl-migration.properties file in the config folder and set parameters in Table 1 as needed.
- Parameter values are case-insensitive.
- You can modify value of the following two parameters db-bteq-tag-name and db-tdsql-tag-name parameters in the following table:
| Parameter | Description | Value Range | Default Value | Example |
|---|---|---|---|---|
| Scripts to be processed in Perl files. BTEQ: Only the scripts under the BTEQ tag will be processed. |
| bteq | db-bteq-tag-name=bteq |
| Only the scripts under the db-tdsql-tag-name tag will be processed. SQL_LANG: Only the scripts under the SQL_LANG tag will be processed. | sql_lang | sql_lang | db-tdsql-tag-name=sql_lang |
| Whether to enable the insertion of scripts to calculate execution time. If it is enabled, the script will be added to each input file. |
| false | add-timing-on=true |
| 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: Delete the intermediate files. false: Do not delete the intermediate files. |
| true | remove-intermediate-files=true |
| Whether to enable the migration of Perl variables containing SQL statements. 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 statements from Perl variables and migrate them. true: Enable the migration of Perl variables containing SQL statements. false: Disable the migration of Perl variables containing SQL statements. Example 1: migrate-variables is set to true and input is as follows: $V_SQL = "CT X1(C1 INT,C2 CHAR(30))"; Output CREATE TABLE X1(C1 INT,C2 CHAR(30)); Example 2: Input $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 $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 | migrate-variables=true |
| Logging level of Teradata Perl migration log files. error: Log only errors. warning: Log errors and warnings. info: Log errors, warnings, and activity information. This level contains all log information. |
| info | logging-level=info |
| Maximum number of log files 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 |
| Maximum file size. Upon reaching the specified size, a file is archived by adding a timestamp to the file name. Example: 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 |
| Whether to enable the migration of execute_query containing SQL statements. true: Enable the migration of execute_query containing SQL statements. false: Disable the migration of execute_query containing SQL statements. For example: migrate-executequery is set to true and input is as follows: my $rows1=$conn1->execute_query("sel ${selectclause} from ${databasename}.${tablename};
"); Output my $rows1=$conn1->execute_query("SELECT
${selectclause}
FROM
${databasename}.${tablename}
;"); |
| true | migrate-executequery =true |
Last Article: Oracle SQL Configuration (GaussDB A)
Next Article: MySQL SQL Configuration
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.