Skip to main content
Version: 1.1 (Latest)

Creating the Target Table

With --loadmode Create, FastTransfer creates the target table from the source, then loads it. The source can be a table, a query or files (CSV, Parquet, JSON).

.\FastTransfer.exe `
--sourceconnectiontype "oraodp" `
--sourceserver "orahost:1521/ORCLPDB1" `
--sourceuser "SALES" `
--sourcepassword "mypassword" `
--sourceschema "SALES" `
--sourcetable "ORDERS" `
--targetconnectiontype "msbulk" `
--targetserver "localhost" `
--targettrusted `
--targetdatabase "dwh" `
--targetschema "stg" `
--targettable "ORDERS" `
--loadmode "Create" `
--inferdatatype "best"

What Create Does​

Target tableWhat happens
Does not existCREATE TABLE from the source, then load
Exists, with the name exactly as typedTruncated, then loaded. Its structure is kept: nothing is inferred, nothing is altered
Exists only in another case (--targettable Orders, stored orders)Error, nothing is created

The created table has the column names and the column order of the source. Every column is nullable, and the table has no key, index or constraint. The target schema must exist.

--loadmode Replace is an alias of Create.

Good to know

If the load fails after the table was created, the table stays, empty or partly loaded. The next run finds it, truncates it and loads it.

Choosing the Column Types​

--inferdatatype tells FastTransfer how to derive the column types of the table it creates. It is used with --loadmode Create only: with another load mode it is ignored, with a warning.

--inferdatatypedefault fast

--inferdatatype "mode"

Allowed Values:

fastDefault

Types from the source metadata. No row is read.

allvarchar

Every column as text, converted on the source.

best

The source data is profiled to find the strictest type that holds every value.

Same database engine on both sides

From Oracle to Oracle, SQL Server to SQL Server and so on, the source types are copied unchanged, whatever --inferdatatype says (allvarchar excepted).

fast​

fast reads the declared types of the source: from the catalog for a table, from the engine for a query. No row is read, so the table is created at once.

Oracle declares little about its numbers and dates, so fast plays safe:

Oracle sourceCreated as
NUMBER with no precisionA float (FLOAT(53), DOUBLE PRECISION...)
NUMBER(p,0)SMALLINT, INT or BIGINT by precision, DECIMAL(p,0) above 18 digits
NUMBER(p,s)DECIMAL(p,s)
DATEDATETIME2(0) / TIMESTAMP(0): an Oracle DATE holds a time

A text column with no declared length (CLOB, text, varchar(max), a Parquet string) gets 256 characters. See the environment variables to change it.

allvarchar​

allvarchar creates text columns only: Unicode text for the text columns, plain text for the others. The values are converted on the source, in one format whatever the machine and its regional settings:

  • . as the decimal point, no thousands separator
  • ISO 8601 dates and timestamps
  • true / false
  • Upper case hexadecimal for binary values

A binary column with no declared length (BLOB, varbinary(max)) stays binary.

best​

best scans the source once and picks the strictest type that holds every value. It applies to Oracle sources and to files read through DuckDB (CSV, Parquet, JSON). For the other sources, whose metadata is already precise, it gives the same types as fast.

Source columnWhat best looks atCreated as
Oracle NUMBER with no precision, FLOATReal range and number of decimalsSMALLINT, INT, BIGINT or DECIMAL(p,s); a float above 18 decimals
Oracle DATEIs there a time part on any row?DATE when no row has one
Oracle CLOB, a file VARCHARLength of the longest valueA bounded text column of that length
File integers, DECIMAL, DOUBLEReal range and number of decimalsThe smallest integer or decimal type
File TIMESTAMPTime part and fractional digits usedDATE, or a timestamp with the digits really used

The types are guarded. Every narrowed column is read through a check: a row that does not fit the inferred type, written after the scan or missed by a sample, fails the load instead of being rounded or truncated. The table created by that run is then dropped, so the next run infers the types again.

Later loads

The types fit the data read at creation time. A later --loadmode Append with larger values fails on the target.

Types With No Equivalent​

  • XML, JSON and arrays are created with the unbounded text type of the target (NVARCHAR(MAX), TEXT, CLOB...).
  • A column whose type has no equivalent on the target (range, network address, interval, enum...) is created as text, with a warning, and converted to text on the source.

Environment Variables​

VariableEffectDefault
FASTTRANSFER_INFER_DEFAULT_STRING_MAXSIZELength of a text column with no declared length, in fast and allvarchar: from 1 to the largest bounded text length of the target, or max for the unbounded type256
FASTTRANSFER_INFER_STRING_MARGINMargin added to a length measured by best: a number of characters (50) or a factor from 2x to 10x0
FASTTRANSFER_INFER_SAMPLE_PERCENTbest reads a sample instead of every row: a block sample of an Oracle table (a query is read in full), USING SAMPLE on files100

An invalid value stops the run, naming the variable.

Limits​

  • A value longer than its column fails the load: it is never truncated. With fast, raise FASTTRANSFER_INFER_DEFAULT_STRING_MAXSIZE when a text column with no declared length holds more than 256 characters.
  • SQL Server target: NaN and infinity are refused in REAL and FLOAT columns.
  • MySQL target: the text columns of a row hold at most 65,535 bytes. A table above that limit is not created: create it yourself, with TEXT columns where needed, and load it with --loadmode Truncate. The server must be in strict mode.
  • MySQL source: a TIME is a duration. A value outside 00:00:00 to 23:59:59 fails on a target TIME column.
  • allvarchar needs a source whose engine is known: it is not available with a generic odbc or oledb source.
  • With a --query and the Physical method, the query must be a single SELECT that lists its columns, or SELECT * on one table.
Tested engines

--loadmode Create is tested on SQL Server, PostgreSQL, Oracle, MySQL, Db2, Teradata (as a source) and DuckDB files. ClickHouse, Netezza, SAP HANA, Teradata as a target and the backup sources are not tested yet.

Copyright © 2026 Architecture & Performance.