ttBulkCp

Copies data between TimesTen tables and ASCII files. ttBulkCp has two modes:
  • In copy-in mode (ttBulkCp -i), rows are copied into an existing TimesTen table from one or more ASCII files (or stdin).

  • In copy-out mode (ttBulkCp -o), an entire TimesTen table is copied to a single ASCII output file (or stdout).

On UNIX and Linux systems, this utility is supported for TimesTen Data Manager DSNs. For Client DSNs, use the utility ttBulkCpCS.

Note:

Although cross-release compatibility over client/server protocol is supported in TimesTen, the tool ttBulkCpCS is not backward and forward release compatible; hence it can be used only for the same version client/server connections.

This utility only copies out the objects owned by the user executing the utility, and those objects for which the owner has SELECT privileges. If the owner executing the utility has the ADMIN privilege, ttBulkCp copies out all objects.

Required Privilege

This utility requires the INSERT privilege on the tables it copies information into. It requires the SELECT privilege on the tables it copies information from.

If authentication information is not supplied in the connection string or DSN, this utility prompts for a user ID and password before continuing.

Usage in TimesTen Scaleout and TimesTen Classic

This utility is supported in both TimesTen Classic and TimesTen Scaleout.

Syntax

ttBulkCp {-h | -help | -? | -helpfull}

ttBulkCp {-V | -version}

ttBulkCp -i [-cp numTrans | final] [-d errLevel] 
[-e errorFile] [-m maxErrs] [-s c] [-t errLevel]
[-u errLevel] [-v 0|1] [-xp numRows | rollback] 
[-Cc | -Cnone] [-tformat timeFormat] [-tsformat timeStampFormat]
[-dformat | -D dateFormat] [-F firstRow] [-L lastRow] 
[-N ncharEncoding] [-Q 0|1] [-S errLevel] [-dateMode dateMode]
[-numThreads numthreads]
[-[no]tblLock] [-localOnly] {-connStr connection_string | DSN} 
[owner.]tableName [dataFile ...]

ttBulkCp -directLoad [-cp numTrans|final] [-d errLevel] [-e errorFile]
[-m maxErrs] [-s c] [-t errLevel] [-u errLevel]
[-v 0|1] [-xp numRows|rollback] [-Cc | -Cnone]
[-dformat formatStr] [-tformat formatStr]
[-tsformat formatStr] [-F firstRow] [-L lastRow]
[-N ncharEncoding] [-Q 0|1] [-S errLevel] [-dateMode mode]
{DSN | [-connstr] connection_string}
[owner.]tblName [dataFile ...]

ttBulkCp -o [-s c] [-v 0|1] [-A 0|1] [-Cc | -Cnone] 
[-nullFormat formatStr] [-localOnly]
[-tformat timeFormat] [-tsformat timeStampFormat] 
[-dateMode dateMode] [-dformat | -D dateFormat]
[-N ncharEncoding] [-noForceSerializable | -forceSerializable]
[-tsprec precision] [-Q 0|1] [-localOnly] 
{-connStr connection_string | DSN} [owner.]tblName 
[dataFile]

Options

ttBulkCp has the options:

Option Description

-Cnone

-Cc

-Cnone disables the use of comments in the output file.-Cc sets the default comment character to c. If no default comment character is specified, the pound character (#) is used. The -C option takes the values: \t (tab) or any of the characters:~ ! @ # % ^ & * ( ) = : ; | < > ? , / This option overrides the COMMENTCHAR file attribute.

-connStr connection_string

An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.

DSN

Specifies an ODBC data source name of the database to be copied.

-D | -dformat

dateFormat

Sets the date format. For a list of supported fixed values, see Fixed Date, Time and Timestamp Formats. This option overrides the DFORMAT file attribute. The default is ODBC.

See also: -tformat and -tsformat.

dataFile

For copy-in mode, specifies the path name(s) of one or more ASCII files containing rows to be inserted into the table. If no files are given, the standard input is used. A single hyphen (-) is understood to mean the standard input.

For copy-out mode, specifies the path name of the file into which rows should be copied. If no file is given, the standard output is used. A single hyphen (-) is understood to mean the standard output.

-dateMode dateMode

Specifies whether ttBulkCp treats an Oracle database DATE type as a date (without hour, minute and second fields) or as a timestamp (with hour, minute and second fields).

For copy-in mode, the default behavior for input is date.

For copy-out mode, the default behavior for output is timestamp.

TimesTen truncates the data and issues a warning if you select -dateMode date in output mode and one or more date columns have a time component that is not 12:00:00 am.

This option overrides the DATEMODE file attribute.

-directLoad

Selects copy-in mode that copies data from an ASCII file into a database table, but can only be used by a client using a direct connection. Avoids some of the overhead required when using a client/server connection, which provides better performance than the -i mode. Can only be used with TimesTen Classic.

-h -help

-?

Prints a short usage message and exits.

-helpfull

Prints a longer usage message and exits.

-i

Selects copy-in mode that copies data from an ASCII file into a database table. Can be used by a client using either a direct connection or a client/server connection.

-localonly

This option only loads rows from a specific instance. Load a specific instance in the grid and use this option. When you use this option, ttBulkCP selects all rows from the table, but ignores any rows that are not hashed to the specific instance.

This option is only supported in TimesTen Scaleout.

The default value is N.

-N ncharEncoding

Specifies the input and output character encoding for NCHAR types. Valid values are UTF8, UTF-8 or ASCII.

-o

Selects copy-out mode.

owner

Specifies the owner of the table to be saved or loaded. If owner is omitted, TimesTen looks for the table under the user's name and then under the user name SYS. This parameter is case-insensitive.

-Q [0 | 1]

Indicates whether character-string values should be enclosed in double quotes.

0 - Indicates that strings should not be quoted. This document refers to this mode as "no quote mode."

1 (default) - Indicates that strings should be quoted.This option overrides the QUOTES file attribute. This document refers to this mode as "quote mode."

-s c

Sets the default field-separator character to c. If no default field-separator is specified, a comma (,) is used. The -s option takes the values \t (tab) or any of the characters:~ ! @ # % ^ & * ( ) = : ; | < > ? , / This option overrides the FSEP file attribute.

tableName

Specifies the name of the table to be saved or loaded. This parameter is case-insensitive.

-tformat

timeFormat

Sets the time format. For a list of supported fixed values, see Fixed Date, Time and Timestamp Formats. The default value is ODBC. This option overrides the TSFORMAT file attribute.

See also: -D | -dformat and -tsformat.

-tsformat

timestampFormat

Sets the timestamp format. For a list of supported fixed values, see Fixed Date, Time and Timestamp Formats. The default value is DF*TF+FF, which is the concatenation of the date format, the time format and fractional seconds. This option overrides the TFORMAT file attribute.

See also: -D | -dformat and -tformat.

-V | -version

Prints the release number of ttBulkCp and exits.

-v [0 | 1]

Sets the verbosity level.

0 - Suppresses the summary.

1 (default) - Prints a summary of rows copied upon completion.

Use the following options in copy-out (-o) mode only. You must have SELECT privileges on the specified tables.

Option Description

-A [0 | 1]

Indicates whether ttBulkCp should suppress attribute lines in the output file.

0 (default) - ttBulkCp may write attribute lines into the output file.

1 - Suppresses output of attribute lines.

-forceSerializable -noForceSerializable

The -forceSerializable option indicates that ttBulkCp should use serializable isolation regardless of the DSN or connection string settings. This is the default behavior.

-noForceSerializable indicates that ttBulkCp should honor the isolation level in the DSN or connection string.

If you specify the -noForceSerializable option and the DSN or connection string indicates a non-serializable isolation mode, a warning is included in the output:

Warning: This output was produced using a
non-serializable isolation level. It may therefore not
reflect a transaction-consistent state of the table.

For more information on isolation modes, see Transaction Isolation Levels in Oracle TimesTen In-Memory Database Operations Guide.

-nullFormat formatStr

Specifies the format in which NULL values are printed. Valid values are:

null (default) - The word NULL is printed for null fields.

empty - Nothing is printed for null fields.

An empty LOB is printed as NULL in no-quotes mode and as " " in quote mode. When copied in, both NULL and " " are interpreted as a NULL LOB.

-tsprec precision

When used with the -o option, truncates timestamp values to precision. ttBulkCp allows up to 6 digits in the fraction of a second field. Truncation may be necessary when copying timestamps using other RDBMS.

Use the following options in copy-in (-i) and directload (-directload) modes only. You must have INSERT privileges on the specified tables.

Option Description

-cp numTrans

-cp final

Sets the checkpoint policy for the copy in.

A value of 0 indicates that ttBulkCp should never checkpoint the database, even after the entire copy is complete.

A nonzero value indicates that ttBulkCp should checkpoint the database after every numTrans transactions, and again after the entire load is complete.

A value of final indicates that ttBulkCp should checkpoint the database only when the entire copy is complete.

The default value is 0.

Periodic checkpoints can only be enabled if periodic commits are also enabled. See the -xp option.

NOTE: This option is not supported in TimesTen Scaleout.

-d error

-d warn

-d ignore

By default, ttBulkCp does not consider rows that are rejected because of constraint violations in a unique column or index to be errors.

-d error - Specifies that constraint violations should be considered errors. Duplicate rows are then counted against maxErrs (see -m) and placed into the error file (see -e).

-d warn - Specifies that ttBulkCp should copy the offending rows into the error file but should not count them as errors.

-d ignore (default) - Specifies that ttBulkCp should silently ignore duplicate rows.

Regardless of the setting of -d, the duplicate rows are not inserted into the table.

-e errFile

Indicates the name of the file in which ttBulkCp should place information about rows that cannot be copied into the TimesTen table because of errors. These errors include parsing errors, type-conversion errors and constraint violations. The value of errFile defaults to stderr. The format of the error file is the same as the format of the input file (see Data File Format), so it should be possible to correct the errors in the error file and use the corrected error file as an input file for a subsequent run of ttBulkCp.

-F firstRow

Indicates the number of the first row that should be copied. Use this option (optionally with -L) to copy a subset of rows into the TimesTen table. Rows are numbered starting at 1. If more than one input file is specified, rows are numbered consecutively throughout all the files. The default value is 1.

-L lastRow

Indicates the number of the last row that should be copied. See the description of -F. A value of 0 specifies the last row of the last input file. The default value is 0.

-m maxErrors

Specifies the maximum number of errors to report.

The default is 1.

If set to 0, ttBulkCp returns all error messages. There is no maximum limit.

-S error

-S warn

-S ignore

By default, ttBulkCp issues an error when it encounters a value that exceeds its maximum scale. This error can be generated for a decimal value whose scale exceeds the maximum scale of its column or for a TIMESTAMP value with more than 6 decimal places of fractional seconds (sub-microsecond granularity).

-S error (default) - Specifies that ttBulkCp should not insert a row containing a value that exceeds its maximum scale into the table and that it should place an error into the error file.

-S warn - Specifies that ttBulkCp should right-truncate the value to its maximum scale before inserting the row into the table and that it should place a warning into the error file.

-S ignore - Specifies that ttBulkCp should silently right-truncate the value to its maximum scale before inserting the row into the table.

-t error

-t warn

-t ignore

By default, ttBulkCp issues an error when a CHAR, VARCHAR2, NCHAR, NVARCHAR2, BINARY, VARBINARY, BLOB, CLOB, or NLOB value is longer than its maximum column width.

-t error (default) - Specifies that rows containing long string or binary attributes should not be inserted into the TimesTen table and that an error should be placed into the error file.

-t warn - Specifies that long string or binary attributes should be truncated to the maximum column length before being inserted into the table but that a warning should be placed into the error file.

-t ignore - Specifies that long string or binary attributes should be silently truncated to the maximum column length before being inserted into the table.

-[no]tblLock

Specifies whether to use table-level or row-level locking, when copying rows into a TimesTen table.

-tblLock - Indicates table-level locking. This is the default.

-notblLock - Indicates row-level locking.

For a single input stream into a table, using -tblLock is most efficient. Using -notblLock provides some performance benefit if you use multiple concurrent ttBulkCp sessions to insert into a single table in parallel.

-u error

-u warn

-u ignore

By default, ttBulkCp issues an error when a real, float or double attribute underflows. Underflow occurs when a floating point number is so small that it is rounded to zero.

-u error (default) - Specifies that rows containing a real, float or double value that underflow should not be inserted into the TimesTen table and that an error should be placed into the error file.

-u warn - Specifies that 0.0 should be inserted for real, float or double attributes that underflow, but that a warning should be placed into the error file.

-u ignore - Specifies that 0.0 should be silently inserted for real, float or double attributes that underflow.

-xp numRows

-xp rollback

Sets the transaction policy for the load. A value of 0 indicates that ttBulkCp should perform the entire load as a single transaction and should commit that transaction whether the load succeeds or fails.

A value of rollback indicates that ttBulkCp should perform the entire load as a single transaction and should roll that transaction back if the load fails.

A nonzero value indicates that ttBulkCp should commit after every numRows processed rows.

The default value is 1024.

Use the -xp option with the -cp option to enable periodic checkpointing of the database.

Data File Format

This section describes the format the dataFile parameter.

Each line of a ttBulkCp input file is either a blank line, a comment line, an attribute line or a data line.

  • Blank lines are lines with no characters at all, including whitespace characters (space and tab). Blank lines are ignored by ttBulkCp.

  • Comment lines begin with the comment character. The default comment character is #; this default can be overridden with the -C command-line option or the COMMENTCHAR file attribute (see File Attribute Line Format). The comment character must be the first character on the line. Comment lines are ignored by ttBulkCp. Comments at the end of data lines are not supported.

  • File attribute lines are used for setting file attributes that control the formatting of the data file. Attribute lines begin with the ten-character sequence ##ttBulkCp. The section File Attribute Line Format describes the full syntax for attribute lines. Attribute lines can appear anywhere in the data file.

  • Data lines contain the rows of the table being copied. Data lines in the data file and rows of the table correspond one-to-one; that is, each data line completely describes exactly one row. Each data line consists of a list of column values separated by the field separator character. The default field separator is a comma (,). This default can be overridden by the -s command-line option or the FSEP file attribute. The section Data Line Format describes the full syntax for data lines.

File Attribute Line Format

The format of an attribute line is:

##ttBulkCp[:attribute=value]...

Attribute lines always begin with the ten-character sequence ##ttBulkCp, even if the comment character is not #. This sequence is followed by zero or more file attribute settings, each preceded by a colon.

File attribute settings remain in effect until the end of the input file or until they are changed by another attribute line in the same input file. The values of any file attributes that are omitted in an attribute line are left unchanged.

Most command line options take precedence over the values in the file attributes that are supported by ttBulkCp. The CHARACTERSET attribute is the only file attribute that overrides command line options.

The file attributes are:

  • CHARACTERSET: Specifies the character set to be used to interpret the data file. If the file attribute is not set, the character set used to interpret the file is the one specified in the ConnectionCharacterSet connection attribute. For best performance, the value of the DatabaseCharacterSet connection attribute should match either the ConnectionCharacterSet connection attribute or this file attribute. If the character set supplied in ConnectionCharacterSet connection attribute or in this file attribute is different than the actual character set of the file, ttBulkCp may interpret data incorrectly.

  • VERSION: Specifies the version of the file format used in the file, expressed as major.minor. The only supported version is 1.0.

  • DATEMODE: Specifies whether an Oracle database DATE type is specified as date or as timestamp.

  • FSEP: Specifies the field separator character used in the file. The field separator can be set to \t (tab) or any of the characters: ~ ! @ # $ % ^ & * ( ) = : ; | < > ? , / .

  • QUOTES: Indicates whether character string values in the file are enclosed in double quotes. The value can be 0, to indicate that strings are not quoted, or 1, to indicate that strings are quoted. This value can be overridden with the -Q option.

  • COMMENTCHAR: Specifies the comment character used in the file. The comment character can be set to \t (tab) or any of the characters: ~ ! @ # $ % ^ & * ( ) = : ; | < > ? , / .

The comment character can also be set to the value none, which disables the use of comments in the data file.

  • DFORMAT: Sets the date format. For a list of supported values, see Fixed Date, Time and Timestamp Formats. When a custom format is used, it should be enclosed in single quotes. This value can be overridden with the -D/-dformat command-line option. See also: TFORMAT and TSFORMAT.

  • NCHARENCODING: Indicates the encoding to be used for the NCHAR and NVARCHAR2 data types. The value may be either ASCII or UTF-8.

  • TFORMAT: Indicates the time format. For a list of supported values, see Fixed Date, Time and Timestamp Formats. When a custom format is used, it should be enclosed in single quotes. This value can be overridden with the -tformat command-line option. See also: DFORMAT and TSFORMAT.

  • TSFORMAT: Sets the timestamp format. For a list of supported values, see Fixed Date, Time and Timestamp Formats. When a custom format is used, it should be enclosed in single quotes. This value can be overridden with the -tsformat command-line option. See also: DFORMAT and TFORMAT.

Examples

The following header line sets the field separator character to $ and disables quoting of character strings:

##ttBulkCp:FSEP=$:QUOTES=0

The following header line disables comments and sets the date format to the Oracle format:

##ttBulkCp:COMMENTCHAR=none:DFORMAT=Oracle

The following header line set the date format to a custom format:

##ttBulkCp:DFORMAT='Mon DD, YYYY'

Data Line Format

Data lines contain the row data of the table being copied. Each data line corresponds to a row of the table; rows cannot span input-file lines. A data line consists of a list of column values separated by the field separator character. Unnecessary whitespace characters should not be placed either before or after the field separator. The format of each value is determined by its type.

NULL Values

NULL values can either be expressed as NULL (all capitals, no quotes) or as empty fields.

Character and Unicode Strings

CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, NCLOB: If quoting of character strings is enabled (the default), then strings and characters must be enclosed in double quotes. If quoting of character strings is disabled, then any double-quote characters in the string are considered to be part of the string itself. ttBulkCp recognizes the following backslash escapes inside a character string, regardless of whether quoting of strings is enabled:

  • \" The double-quote character. If character-string quoting is enabled, then all double quote characters in the string must be escaped with a backslash. If character-string quoting is disabled, then it is permissible, but not necessary, to use the backslash.

  • \t The tab character.

  • \n The newline character.

  • \r The carriage return character.

  • \\ The backslash character.

  • \xyz (CHAR and VARCHAR2 only) The character whose ASCII value is xyz, where xyz is a three-character octal number, as in \033.

  • \uxyzw (NCHAR and NVARCHAR2 only) The character whose unicode value is xyzw, where xyzw is a four-digit hexadecimal number, as in\ufe4a. The \uxyzw notation is supported in both UTF-8 and ASCII encoding modes.

In addition, any of the ~ ! @ # $ % ^ & * ( ) = : ; | < > ? , / characters can be escaped with a backslash. Although it is unnecessary to escape these characters usually, doing so prevents them from being mistaken for a comment character or a field separator when character-string quoting is disabled.

If character-string quoting is enabled, the empty string (represented as " ") is distinct from NULL. If character-string quoting is disabled, then empty strings cannot be represented, as they cannot be distinguished from NULL.

For unicode strings, unicode characters encoded using UTF-8 multibyte sequences are supported in the UTF-8 encoding mode only. If these sequences are used with the ASCII encoding mode, ttBulkCp interprets each byte in the sequence as a separate character.

For fixed-length CHAR and NCHAR fields, strings that are shorter than the field length are padded with blanks. For VARCHAR2 and NVARCHAR2 fields, the string is entered into TimesTen exactly as given in the data file. Trailing blanks are neither added nor removed.

Binary Values

BINARY, VARBINARY, BLOB: If quoting of character strings is enabled (the default), binary values are delimited by curly braces ({...}). If quoting of character strings is disabled, then curly braces should not be used. Whether character-string quoting is enabled or disabled, binary values may start with an optional 0x or 0X.

Each byte of binary data is expressed as two hexadecimal digits. For example, the four-byte binary string:

01101000 11001010 01001001 11101111

would be expressed as the eight-character hexadecimal string:

68CA49EF

Digits represented by the letters A through F can either be upper- or lower-case. The hexadecimal string cannot contain white spaces. Because each pair of characters in the hexadecimal string is converted to a single binary byte, the hexadecimal string must contain an even number of characters. For fixed-length binary fields, if the given value is shorter than the column length, the value is padded with zeros on the right. For VARBINARY values, the binary value is inserted into TimesTen exactly as given in the data file.

If character-string quoting is enabled, a zero-length binary value (represented as { }) is distinct from NULL. If character-string quoting is disabled, then zero-length binary values cannot be represented, as they cannot be distinguished from NULL.

Integer Values

TINYINT, SMALLINT, INTEGER, BIGINT: Integer values consist of an optional sign followed by one or more digits. Integer values may not use E-notation. Examples:

-14 98765 +186

Floating-Point Values

REAL, FLOAT, DOUBLE: Floating-point values can be expressed with or without decimal points and may use E-notation. Examples:

3.1415
-0.00004
1.1e-3
5e3
.56
-682
-.62E-4
170.

Fixed-Point Values

DECIMAL, NUMERIC: Decimal values can be expressed with or without decimal points. Decimal values may not use E-notation. Examples:

5
-19.5
-11
000
-.1234
45.
-57.0
0.8888

Inf, -Inf and NaN Values

Inf, -Inf and Nan values: Infinity and Not a Number values can be represented as strings to represent the corresponding constant value (all are case insensitive):

String Value

NAN

NaN

[+]INF

Inf

-INF

-Inf

TimesTen outputs the values as: NAN, INF and -Inf.

Fixed Date, Time and Timestamp Formats

For date values, the fixed formats are:

Format Description

ODBC

YYYY-MM-DD

Example: 2011-01-03

(default value)

Oracle

DD-Mon-YYYY

Example: 03-Jan-2011

SYBASE1

MM/DD/YYYY

Example: 01/03/2011

SYBASE2

DD-MM-YYYY

Example: 03-01-2011

SYBASE3

Mon*DD*YYYY

Example: Jan 03 2011

For time values, the only fixed format is ODBC:

Format Description

ODBC

HH24:MI:SS

Example: 07:47:23

For timestamp values, the fixed formats are:

Format Description

ODBC

YYYY-MM-DD*HH24:MI:SS+FF

Example: 2011-01-03 07:47:23

Oracle

DD-Mon-YYYY*HH24:MI:SS+FF

Example: 03-Jan-2011 07:47:23

SYBASE1

MM/DD/YYYY*HH24:MI:SS+FF

Example: 01/03/2011 07:47:23

SYBASE2

DD-MM-YYYY*HH24:MI:SS+FF

Example: 03-01-2011 07:47:23

SYBASE3

Mon*DD*YYYY*HH24:MI:SS+FF

Example: Jan 03 2011 07:47:23

The default timestamp value is: 'DF*TF+FF'

Date, Time and Timestamp Values

Formats for date, time and timestamp values can be specified either by selecting a fixed datetime format or by defining a custom datetime format. The custom datetime formats are defined using format specifiers similar to those used by the TO_DATE and TO_CHAR SQL functions, as described in the following table.

In many cases, it is not necessary to define the timestamp format, even when a custom date or time format is used, because the default TimesTen format (DF*TF+FF) is defined in terms of the date and time formats. Therefore, setting the date format sets not only the format for date values, but also for the date portion of timestamp values. Similarly, setting the timestamp format affects both time values and the time portion of the timestamp values.

Specifier Descriptions and restrictions

Q

Quarter. Cannot be used in copy-in mode.

YYYY

Year (four digits).

Y,YYY

Year (with comma as shown).

YYY

Year (last three digits). Cannot be used in copy-in mode.

Y

Year (last digit). Cannot be used in copy-in mode.

MONTH

Month (full name, blank-padded to 9 characters, case-insensitive).

MON

Month (three character prefix, case-insensitive).

MM

Month (01 through 12).

DD

Day of the month (01 through 31).

HH24

Hour (00 through 23).

HH12

Hour (01 through 12). Must be used with AM/PM for copy-in mode.

HH

Hour (01 through 12). Must be used with AM/PM for copy-in mode.

MI

Minute (00 through 59).

SS

Second (00 through 59).

FF

Fractional seconds.Six digits, unless overridden with the -tsprec option.

FFn

Fractional seconds (number of digits specified by n).

+FF

In copy-in mode, matches, optional decimal point plus one or more fractional seconds. In copy-out mode, same as .FF.

+FFn

In copy-in mode, same as +FF. In copy-out mode, same as .FFn.

AM PM

Meridian indicator without dots. In copy-in mode, this must be used with HH or HH12, but not HH24.

A.M.

P.M.

Meridian indicator with dots. In copy-in mode, this must be used with HH or HH12, but not HH24.

DF

Current date format (can only be used in timestamp format).

TF

Current time format (can only be used in timestamp format).

- / ; :

Punctuation that are matched in copy-in mode or output in copy-out mode.

"text"

Text that is matched in input mode or output in copy-out mode.

*

Matches 0 or more whitespace characters (space or tab) in copy-in mode or outputs 1 space in copy-out mode.

Examples

The following input file is for a table with five columns: two char columns, a double column, an integer column and a VARBINARY column. In the "Mountain View" line, the last three columns have NULL values.

##ttBulkCp
# This is a comment.
###### So is this.
# The following line is a blank line.

"New York","New York",-345.09,12,{12EF87A4E5}
"Milan","Italy",0,0,{0x458F}
"Paris","France",1.4E12,NULL,{F009}
"Tokyo","Japan",-4.5E-18,26,{0x00}
"Mountain View","California",,,

Here is an equivalent input file in which quotes are disabled, the comment character is '$' and the field separator is '|':

##ttBulkCp:QUOTES=0:COMMENTCHAR=$:FSEP=|
$ This is a comment.
$$$$$$ So is this.
$ The following line is a blank line.

New York|New York|-345.09|12|12EF87A4E5
Milan|Italy|0|0|0x458F
Paris|France|1.4E12|NULL|F009
Tokyo|Japan|-4.5E-18|26|0x00
Mountain View|California|||

The following command dumps the contents of table mytbl from database mystore into a file called mytbl.dump.

% ttBulkCp -o mystore mytbl mytbl.dump

The following command loads the rows listed in file mytbl.dump into a table called mytbl on database mystore, placing any error messages into the file mytbl.err.

% ttBulkCp -i -e mytbl.err mystore mytbl mytbl.dump

The above command terminates after the first error occurs. To force the copy to continue until the end of the input file (or a irrecoverable error), use -m 0, as in:

% ttBulkCp -i -e mytbl.err -m 0 mystore mytbl mytbl.dump

To ignore errors caused by constraint violations, use -d ignore, as follows.

% ttBulkCp -i -e mytbl.err -d ignore mystore mytbl mytbl.dump

Notes

ttBulkCp explicitly sets the Overwrite connection attribute to 0, to prevent accidental destruction of a database. For more information, see Overwrite.

Real, float or double values may be rounded to zero when the floating point number is small.

The connection attribute PassThrough with a nonzero value is not supported in this utility and returns an error.

When specifying date, time and timestamp formats, incomplete or redundant formats are not allowed in input mode. Specifiers that reference fields that are not present in the data type (for example a minute specifier in a date format) return errors in copy-out mode. In copy-in mode, the values of those specifiers are ignored.

The following caveats apply when disabling quoted strings in the ttBulkCp data file:

  • Empty strings and zero-length binary values cannot be expressed, as they cannot be distinguished from NULL.

  • If the field separator character appears inside a character string, it must be escaped with a backslash or else it is treated as an actual field separator.

  • If a data line begins with a character string and that string begins with the comment character, that character must be escaped with a backslash or else the line is treated as a comment. If there are no actual comments in the file, set the comment character to none to avoid characters from being misread as comment characters.

For UTF-8, NCHAR are converted to UTF-8 encoding and then output. UTF-8 input is converted to NCHAR.

For ASCII, those NCHAR values that correspond to ASCII characters are output as ASCII. For those NCHAR values outside of the ASCII range, the escaped Unicode format is used.

This utility is for use specifically with TimesTen tables. It is not supported with passthrough to an Oracle database.

On Windows, this utility is supported for all TimesTen Data Manager and Client DSNs.

It is recommended that you do not run DDL SQL commands while running ttBulkCp to avoid lock contention issues for your application.