HiRDB Datareplicator Version 8 Description, User's Guide and Operator's Guide
![[Contents]](FIGURE/CONTENT.GIF)
![[Glossary]](FIGURE/GLOSS.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
5.5.4 Transmission definition statement
A transmission definition statement selects and sends update information extracted from the source database to a target identifier. The update information to be sent to a destination depends on how the transmission statements are specified. The following table shows the specification of transmission statements and the update information to be sent.
Table 5-8 Specification of transmission statements and the update information to be sent
| Specification of transmission statements |
Update information to be sent |
| Destination is specified in transmission statement |
Destination is not specified in transmission statement |
| No transmission statements specified (omitted) |
N/A |
Update information for all update information names is sent to all destinations. |
| Transmission statements specified for some destinations |
Update information for only those update information names specified in the transmission statements is sent. |
Update information for all update information names is sent. |
| Transmission statements specified for all destinations |
Same as above. |
N/A |
- Organization of this subsection
- (1) Format
- (2) Explanation of the operands
- (3) Notes
(1) Format
[{{ send target-identifier from update-information-name
[ where column-name {relational-operator literal|in(literal[,literal] ...)
|flike(comparison-start-position,literal)}
[ and column-name {relational-operator literal|in(literal[,literal] ...)
|flike(comparison-start-position,literal)}]]
}}...]
(2) Explanation of the operands
- send target-identifier
~ <symbolic name of 1-8 characters>
Specify a target identifier that is to be subject to transmission of update information. This target identifier must be specified in the extraction system definition.
- from update-information-name
~ <symbolic name of 1-8 characters>
Specify the name assigned to the update information that is to be subject to transmission to the target identifier specified in the send clause. This update information name must be specified in an extraction statement.
You can use right truncation to send to the same destination multiple units of update information, all of whose update information names begin with the same character string. Specify the common characters, followed by the percent sign (%); the percent sign can represent any number of characters, including no characters.
- Example of right truncation
- ABC%
Datareplicator sends update information for all update information names beginning with ABC (such as ABC, ABCAA, ABCABC).
- where clause
By specifying a where clause, you can send only update information that satisfies specified conditions. The following explains the information that can be specified in the where clause:
- column-name
Specify the name of a mapping key in the update data subject to transmission. A mapping key column that is specified as a selection condition column must have one of the attributes listed in the table below. An error results if you specify a column that is not a mapping key column or a column whose attribute is not listed this table.
Table 5-9 Attributes of the mapping key columns that can be specified in the selection conditions
| Column attribute |
Length, precision |
Scaling |
Permitted length |
| char(n) |
n <= 255 |
N/A |
1 <= n <= 255 |
| mchar(n) |
n <= 255 |
N/A |
1 <= n <= 255 |
| nchar(n) |
n <= 127 |
N/A |
1 <= n <= 127 |
| varchar(n) |
n <= 255 |
N/A |
1 <= n <= 255 |
| mvarchar(n) |
n <= 255 |
N/A |
1 <= n <= 255 |
| nvarchar(n) |
n <= 127 |
N/A |
1 <= n <= 127 |
| [large]decimal(m,n) |
1 <= m <= 38 |
0 <= n <= 38 |
1 <= m <= 38, m <= n |
| Integer |
4 bytes |
N/A |
4 bytes |
| smallint |
2 bytes |
N/A |
2 bytes |
- relational-operator
Specify any of the following six relational operators:
=, <>, >, >=, <, <=
- literal
Specify a literal that is to be subject to comparison in the selection condition. Table 5-10 Literals permitted in a selection condition lists the literals permitted in selection conditions. Table 5-11 Relationship between a literal and the attribute of the selection condition column shows the relationship between a literal and the attribute of the selection condition column.
Table 5-10 Literals permitted in a selection condition
| Type of literal |
Description |
Example |
| Character string literal |
Character string enclosed in single quotation marks.
To specify a single quotation mark in a character string literal, specify two consecutive single quotation marks, which will be recognized as one character of data. A literal's length must be 1 to 255 bytes. |
'AB''CD' |
| Exact numeric literal or unsigned integer |
Character string consisting of sign (+, -), number, and decimal point. You can specify a decimal number with a length of up to 29 digits. |
-100
12.3 |
Table 5-11 Relationship between a literal and the attribute of the selection condition column
| Column attribute |
Literal |
| Character string literal |
Exact numeric literal or unsigned integer |
| char(n) |
Y#1 |
-- |
| mchar(n) |
Y#1 |
-- |
| nchar(n) |
Y#1 |
-- |
| varchar(n) |
Y# 2 |
-- |
| mvarchar(n) |
Y# 2 |
-- |
| nvarchar(n) |
Y#2 |
-- |
| [large]decimal(m,n) |
-- |
Y |
| integer |
-- |
Y#3 |
| smallint |
-- |
Y#4 |
Y: Literal can be specified
--: Literal cannot be specified
#1: n < length of character string literal: Definition error.
n > length of character string literal: Datareplicator pads the character string literal with space characters to adjust its length to the column length, and then compares. For a column with a character set specification, Datareplicator pads the character string literal with the space characters of that column's character set. For a column with no character set specification, Datareplicator pads the character string literal with the space characters of the locale specified in the dblocale operand in the extraction system definition. For nchar, Datareplicator adds double-byte spaces; a definition error results if you specify an odd number of bytes for a character string literal for a column with the nchar attribute.
#2: n < length of character string literal: Definition error.
n > length of character string literal: Datareplicator compares the character string literal only from the left and, if they match, compares the rest of the character string.
#3: You can specify an integer in the range -2147483648 to 2147483647. Specification of any other value will result in a definition error.
#4: You can specify an integer in the range -32768 to 32767. Specification of any other value will result in a definition error.
- in(literal[,literal...])
Specify a matching condition. Specify one or more literals such that the condition will be true if any of the specified literals matches the data in the specified selection condition column. You can specify a maximum of 16 literals in this condition. The specification for the literal specified with the relational operator also applies to these literals.
- flike(comparison-start-position,literal)
Specify a partial matching condition. The condition will be true if the character string beginning at the specified comparison start position in the selection condition column data matches the specified literal. The permitted range of comparison start positions is from 0 to 254. The specification for the literal specified with the relational operator also applies to this literal. However, Datareplicator adds no space characters to this literal during comparison.
If the definition length of the selection condition column is shorter than (comparison start position + defined length), a definition error results. If the selection condition column is a variable-length column and the length of the real data in the selection condition column is shorter than (comparison start position + defined length), the condition is false.
- A definition error results if you specify more than one transmission statement containing the same target identifier and update information name.
- You must specify the transmission definition statements so that there is at least one destination for each update information name defined in the extraction statements. If no destination can be determined for update information, a definition error results.
- You can specify a maximum of 256 selection conditions in the where clause.
- You cannot specify the where clause if you use right truncation to specify the update information name in the from clause.
- You cannot specify the where clause if you specify the from clause to make multiple update information names from the same table subject to extraction (defining multiple update information names).
- If a column with a character set specification is specified for the selection condition in the where clause, the comparison results depend on the relationship among the characters in the character set specified for that column.
- If the selection condition column data is the null value, the condition will be false.
- If the ukey clause is specified in the extract statement that defines the update information name specified in the send statement, Datareplicator uses pre-update data to check the conditions. If you update a mapping key column specified in a transmission condition to a value that does not satisfy the transmission condition, the destination data will be updated to a key that is not subject to transmission. In this case, the updated data becomes invalid and the correct data will not be found at the destination corresponding to the updated value.
To update a mapping key column specified in a transmission condition to a value outside the range of the transmission conditions, you must execute DELETE and INSERT to achieve data conformity instead of simply executing UPDATE.
All rights reserved. Copyright (C) 2007, 2013, Hitachi, Ltd.