在本节中,表 5 显示每个数据类型的优先权列表。请注意:
若确实存在这样的重复函数,则选择调用哪个函数是由两遍算法来确定的。第一遍尝试使用用于解析非 Unicode 数据库中的函数的算法来查找匹配项。若找不到匹配项,则会根据 CHAR 和 GRAPHIC 字符串的以列提升优先权来执行第二遍算法:
GRAPHIC-->CHAR-->VARGRAPHIC-->VARCHAR-->LONG VARGRAPHIC-->LONG VARCHAR--> -->DBCLOB-->CLOB
以下条目已经添加至列表,并指出“涉及单值类型的下列强制转型是受支持的”:
以下是对“Table 6. Supported Casts between Built-in Data Types”的更新。只包括了该表中受影响的行。
表 18. Supported Casts between Built-in Data Types
Target Data Type > Source Data Type V |
CH A R |
V A R CH A R |
L O N G V A R CH A R |
CL O B |
G R A P H I C |
V A R G R A P H I C |
L O N G V A R G R A P H I C |
D B CL O B |
---|---|---|---|---|---|---|---|---|
CHAR | Y | Y | Y | Y | Y1 | Y1 | - | - |
VARCHAR | Y | Y | Y | Y | Y1 | Y1 | - | - |
LONGVARCHAR | Y | Y | Y | Y | - | - | Y1 | Y1 |
CLOB | Y | Y | Y | Y | - | - | - | Y1 |
GRAPHIC | Y1 | Y1 | - | - | Y | Y | Y | Y |
VARGRAPHIC | Y1 | Y1 | - | - | Y | Y | Y | Y |
LONGVARGRAPHIC | - | - | Y1 | Y1 | Y | Y | Y | Y |
DBCLOB | - | - | - | Y1 | Y | Y | Y | Y |
涉及到字符和图形数据的指定和比较仅当其中一个字符串为文字时才受支持。对于函数解析,图形文字和字符文字都将与字符和图形函数参数相匹配。
以下是对“Table 7. Data Type Compatibility for Assignments and Comparisons”的更新。仅包括受影响的表行和新脚注 6:
Operands | Binary Integer | Decimal Number | Floating Point | Character String | Graphic String | Date | Time | Time- stamp | Binary String | UDT |
---|---|---|---|---|---|---|---|---|---|---|
Character String | No | No | No | Yes | Yes 6 | 1 | 1 | 1 | No 3 | 2 |
Graphic String | No | No | No | Yes 6 | Yes | No | No | No | No | 2 |
Storage Assignment
这一小节的最后一段修改为如下所示:
When a string is assigned to a fixed-length column and the length of the string is less than the length attribute of the target, the string is padded to the right with the necessary number of single-byte, double-byte, or UCS-22 blanks. The pad character is always a blank even for columns defined with the FOR BIT DATA attribute.
Retrieval Assignment
这一小节的第三段修改为如下所示:
When a character string is assigned to a fixed-length variable and the length of the string is less than the length attribute of the target, the string is padded to the right with the necessary number of single-byte, double-byte, or UCS-22 blanks. The pad character is always a blank even for strings defined with the FOR BIT DATA attribute.
Conversion Rules for String Assignments
已经将下图添加至这一小节的结尾:
For Unicode databases, character strings can be assigned to a graphic column, and graphic strings can be assigned to a character column.
DBCS Considerations for Graphic String Assignments
这一小节的第一段已修改为如下所示:
Graphic string assignments are processed in a manner analogous to that for character strings. For non-Unicode databases, graphic string data types are compatible only with other graphic string data types, and never with numeric, character string, or datetime data types. For Unicode databases, graphic string data types are compatible with character string data types.
Conversion Rules for Comparison
这一小节已修改为如下所示:
When two strings are compared, one of the strings is first converted, if necessary, to the encoding scheme and code page of the other string. For details, see the "Rules for String Conversions" section of "Chapter 3. Language Elements" in the SQL Reference.
这是插入到“Graphic Strings”小节后面的新的小节。
In a Unicode database, character strings and graphic strings are compatible.
If one operand is... | And the other operand is... | The data type of the result is... |
---|---|---|
GRAPHIC(x) | CHAR(y) or GRAPHIC(y) | GRAPHIC(z) where z = max(x,y) |
VARGRAPHIC(x) | CHAR(y) or VARCHAR(y) | VARGRAPHIC(z) where z = max(x,y) |
VARCHAR(x) | GRAPHIC(y) or VARGRAPHIC | VARGRAPHIC(z) where z = max(x,y) |
LONG VARGRAPHIC | CHAR(y) or VARCHAR(y) or LONG VARCHAR | LONG VARGRAPHIC |
LONG VARCHAR | GRAPHIC(y) or VARGRAPHIC(y) | LONG VARGRAPHIC |
DBCLOB(x) | CHAR(y) or VARCHAR(y) or CLOB(y) | DBCLOB(z) where z = max(x,y) |
DBCLOB(x) | LONG VARCHAR | DBCLOB(z) where z = max(x,16350) |
CLOB(x) | GRAPHIC(y) or VARGRAPHIC(y) | DBCLOB(z) where z = max(x,y) |
CLOB(x) | LONG VARGRAPHIC | DBCLOB(z) where z = max(x,16350) |
第三点已添加至本节的以下列表:
For each pair of code pages, the result is determined by the sequential application of the following rules:
已经添加了下列内容:
In a Unicode database, an expression that accepts a character or graphic string will accept any string types for which conversion is supported.
已将以下内容添加至这一小节的末尾:
In a Unicode database, concatenation involving both character string operands and graphic string operands will first convert the character operands to graphic operands. Note that in a non-Unicode database, concatenation cannot involve both character and graphic operands.
以下条目已添加至由语句“The following rules apply to all types of predicates”所指示的列表: