MariaDB - Loader configurations

MariaDB - Loader configurations

For Linux

MariaDB supports DB loader capabilities. See the following configurations.

User load configurations

LoaderCommand = <Partition_HOME>/partition1/mysql.sh <CONTROLFILE>
LoaderCommandForAppend = <Partition_HOME>/partition1/mysql.sh <CONTROLFILE>
LoaderControlFileSpecifiesFields = FALSE
LoaderControlFileTemplate = load.ctr
LoaderControlFileTemplateForAppend = load_append.ctr

Sample mysql.sh file

mysql -h 10.115.145.106 -u<UserName> -p<Password> <DB_Name> < $1
rc=$?
exit $rc

For Windows

MariaDB supports DB loader capabilities. See the following configurations.

User load configurations

LoaderCommand = <Partition_HOME>/partition1/mysql.bat <CONTROLFILE>
<DSN> <DBUSER> <PASSWORD>
LoaderCommandForAppend = <Partition_HOME>/partition1/mysql.bat
<CONTROLFILE> <DSN> <DBUSER> <PASSWORD>
LoaderControlFileSpecifiesFields = TRUE
LoaderControlFileTemplate = load.ctr
LoaderControlFileTemplateForAppend = load_append.ctr

Sample mysql.bat file

"C:\Program Files\MariaDB 10.6\bin\mysql.exe" -h localhost -u"%3" -p"%4" %2 < %1
exit %errorlevel%

Sample load.ctr file

load data local infile '<DATAFILE>'
replace into table <TABLE>
fields terminated by '|'
OPTIONALLY ENCLOSED BY '"'

Sample load_append.ctr file

load data local infile '<DATAFILE>'
IGNORE into table <TABLE>
fields terminated by '|'
OPTIONALLY ENCLOSED BY '"'

Fast loader repeated tokens

When you create a LoaderControlFileTemplate or a LoaderControlFileTemplateForAppend, a list of special tokens is repeated once for each field in the outbound table.

The available tokens are described in the following table.
Table 1. Fast loader repeated tokens
Token Description
<CONTROLFILE>

This token is replaced with the full path and file name to the temporary control file that Unica Campaign generates according to the template that is specified in the LoaderControlFileTemplate parameter.

<DSN>

This token is replaced with the value of the DSN property. If the DSN property is not set, the <DSN> token is replaced by the data source name used in the category name for this data source (the same value used to replace the <DATABASE> token).

<DATABASE> This token is replaced with the name of the data source that Unica Campaign is loading data into. This is the same data source name used in the category name for this data source.
<DATAFILE> This token is replaced with the full path and file name to the temporary data file created by Unica Campaign during the loading process. This file is in the Unica Campaign Temp directory, UNICA_ACTMPDIR.
<NUMFIELDS> This token is replaced with the number of fields in the table.
<PASSWORD> This token is replaced with the database password from the current flowchart connection to the data source.
<TABLE> This token is obsolete, but is supported for backward compatibility. See <TABLENAME>, which replaced <TABLE> as of version 4.6.3
<TABLENAME> This token is replaced with the database table name that Unica Campaign is loading data into. This is the target table from your Snapshot process or the name of the Temp Table being created by Unica Campaign.
<USER> This token is replaced with the database user from the current flowchart connection to the data source.