Skip to main content

Target Database Info

After establishing a connection to your target database, you need to specify where the data should be written. This page covers target database, schema, and table parameters.

Target Database

Specify the target database name where data will be transferred.

Syntax:

  • Short form: -D "database_name"
  • Long form: --targetdatabase "database_name"

Example:

./FastTransfer \
...
--targetserver "mytarget.example.com" \
--targetdatabase "ProductionDB" \
...
Database Requirement

The target database must exist before running FastTransfer. FastTransfer does not create databases automatically. Use your database's native tools to create the target database if it doesn't exist.

Database by Platform

Different database platforms have different naming conventions:

SQL Server:

--targetdatabase "AdventureWorks2022"

PostgreSQL:

--targetdatabase "production"

MySQL:

--targetdatabase "ecommerce_db"

Oracle:

# For Oracle, the database is typically part of the connection
--targetserver "oracleserver:1521/PRODPDB"

ClickHouse:

--targetdatabase "analytics"

DuckDB:

# For DuckDB, the database is the file path in --targetserver
--targetserver "/data/warehouse.duckdb"

Target Schema

Specify the schema (or owner) where the target table resides.

Syntax:

  • Short form: -S "schema_name"
  • Long form: --targetschema "schema_name"

Example:

./FastTransfer \
...
--targetserver "mytarget.example.com" \
--targetdatabase "ProductionDB" \
--targetschema "staging" \
...
Schema Defaults

If not specified, FastTransfer uses the default schema for the connection:

  • SQL Server: dbo
  • PostgreSQL: public
  • Oracle: The username
  • MySQL: Does not use schemas (use database only)

Schema Examples by Platform

SQL Server:

--targetschema "dbo"
--targetschema "sales"
--targetschema "staging"

PostgreSQL:

--targetschema "public"
--targetschema "analytics"
--targetschema "etl"

Oracle:

--targetschema "SCOTT"
--targetschema "HR"

SAP HANA:

--targetschema "SAPABAP1"
--targetschema "_SYS_BIC"

Target Table

Specify the target table name where data will be inserted.

Syntax:

  • Short form: -T "table_name"
  • Long form: --targettable "table_name"

Example:

./FastTransfer \
...
--targetserver "mytarget.example.com" \
--targetdatabase "ProductionDB" \
--targetschema "dbo" \
--targettable "customers" \
...
Target Table Must Exist

The target table must already exist before running FastTransfer. The tool does not create tables automatically. Additionally:

  • The table must have a compatible schema with the source data
  • Column names must match (when using Name mapping) or column count must match (when using Position mapping)
  • Data types must be compatible between source and target

Fully Qualified Table Names

For some databases (like Oracle), you can specify the schema as part of the table name:

Oracle:

--targettable "SCOTT.EMPLOYEES"

PostgreSQL (alternative to separate schema parameter):

--targettable "public.users"

Complete Target Specification Example

Here's a complete example specifying all target location parameters:

SQL Server Target:

./FastTransfer \
--sourceconnectiontype pgsql \
--sourceserver "pg.example.com" \
--sourcedatabase "ecommerce" \
--sourceschema "public" \
--sourcetable "orders" \
--targetconnectiontype mssql \
--targetserver "sqlserver.example.com\PROD" \
--targetuser "etl_user" \
--targetpassword "SecurePass123" \
--targetdatabase "DataWarehouse" \
--targetschema "staging" \
--targettable "orders_staging"

PostgreSQL Target:

./FastTransfer \
--sourceconnectiontype mssql \
--sourceserver "sqlserver.example.com" \
--sourcedatabase "Sales" \
--sourceschema "dbo" \
--sourcetable "customers" \
--targetconnectiontype pgsql \
--targetserver "pg.example.com" \
--targetuser "postgres" \
--targetpassword "pgpass" \
--targetdatabase "analytics" \
--targetschema "public" \
--targettable "customers"

MySQL Target:

./FastTransfer \
--sourceconnectiontype pgsql \
--sourceserver "pg.example.com" \
--sourcedatabase "webapp" \
--sourcetable "products" \
--targetconnectiontype mysql \
--targetserver "mysql.example.com:3306" \
--targetuser "root" \
--targetpassword "mysqlpass" \
--targetdatabase "inventory" \
--targettable "products"

Creating Target Tables

Since FastTransfer requires the target table to exist, you need to create it beforehand. Here are examples for different platforms:

SQL Server

CREATE TABLE staging.orders_staging (
order_id INT PRIMARY KEY,
customer_id INT,
order_date DATETIME,
total_amount DECIMAL(10,2),
status VARCHAR(50)
);

PostgreSQL

CREATE TABLE public.customers (
customer_id INTEGER PRIMARY KEY,
first_name VARCHAR(100),
last_name VARCHAR(100),
email VARCHAR(255),
created_at TIMESTAMP
);

MySQL

CREATE TABLE inventory.products (
product_id INT PRIMARY KEY,
product_name VARCHAR(255),
price DECIMAL(10,2),
stock_quantity INT
);

Oracle

CREATE TABLE SCOTT.EMPLOYEES (
EMP_ID NUMBER PRIMARY KEY,
FIRST_NAME VARCHAR2(50),
LAST_NAME VARCHAR2(50),
HIRE_DATE DATE,
SALARY NUMBER(10,2)
);

Column Mapping

FastTransfer maps columns between source and target tables using one of two methods:

Position Mapping (Default)

Columns are mapped by their position (1st column to 1st column, 2nd to 2nd, etc.):

--mapmethod Position

This requires the column count to match, but names can differ.

Name Mapping

Columns are mapped by their names:

--mapmethod Name

This allows different column orders but requires matching column names.

See Advanced Parameters for more details on --mapmethod.

Load Modes

FastTransfer supports two load modes for the target table:

Append Mode (Default)

Data is inserted into the target table without removing existing data:

--loadmode Append

Truncate Mode

Target table is truncated before inserting new data:

--loadmode Truncate
Truncate Warning

Truncate mode will permanently delete all existing data in the target table before loading new data. Use with caution in production environments.

See Advanced Parameters for more details on --loadmode.

Troubleshooting

Table Not Found

Error: "Table 'schema.table' does not exist"

Solutions:

  • Verify the target table exists: SELECT * FROM information_schema.tables WHERE table_name='yourtable'
  • Check schema spelling and case sensitivity (especially Oracle, which is case-sensitive)
  • Ensure you have permissions to access the table

Column Count Mismatch

Error: "Column count mismatch between source and target"

Solutions:

  • When using Position mapping, ensure source and target have the same number of columns
  • Switch to Name mapping if column counts differ: --mapmethod Name
  • Modify your source query to select only matching columns: --query "SELECT col1, col2 FROM source_table"

Data Type Incompatibility

Error: "Cannot convert source type X to target type Y"

Solutions:

  • Review column data types in both source and target tables
  • Modify target table schema to accommodate source data types
  • Use SQL transformations in source query to cast types: --query "SELECT CAST(col AS VARCHAR) FROM table"

Permission Denied

Error: "INSERT permission denied on table 'table_name'"

Solutions:

  • Grant INSERT permission to the target user
  • For Truncate mode, also grant TRUNCATE or DELETE permissions
  • Verify user has CONNECT permission to the target database
Copyright © 2026 Architecture & Performance. Built with Docusaurus.