fuxc_666 发表于 2009-06-16 17:15

db2 中Literal Replacement怎么理解,一直不明白,能否举例说明。

关于Literal Replacement功能不知道怎么实现,我的理解是:常量替换,允许只有常量不同,但其他都相同的SQL语句共享一个公共section. 从而降低编译成本。但不知道怎么才能实现,看到效果,请高手不吝指教!有相关的资料也可以!多谢!

ziggler 发表于 2009-06-16 18:16

NCHAR String Literal Replacement

This section provides information on how to avoid data loss when performing NCHAR string literal replacement.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/ch7progrunicode.htm

ziggler 发表于 2009-06-16 18:19

回复 #1 fuxc_666 的帖子

NCHAR String Literal Replacement

This section provides information on how to avoid data loss when performing NCHAR string literal replacement.

Being part of a SQL or PL/SQL statement, the text of any literal, with or without the prefix N, is encoded in the same character set as the rest of the statement. On the client side, the statement is in the client character set, which is determined by the client character set defined in NLS_LANG, or specified in the OCIEnvNlsCreate() call, or predefined as UTF-16 in JDBC. On the server side the statement is in the database character set.

    *

      When the SQL or PL/SQL statement is transferred from client to the database server, its character set is converted accordingly. It is important to note that if the database character set does not contain all characters used in the text literals, then the data is lost in this conversion. This problem affects NCHAR string literals more than the CHAR text literals. This is because the N' literals are designed to be independent of the database charactser set, and should be able to provide any data that the client character set supports.

      To avoid data loss in conversion to an incompatible

fuxc_666 发表于 2009-06-17 09:46

我刚看到回复的信息,我还是不太明白,链接中所说的,能否有个例子说明一下,多谢!
页: [1]
查看完整版本: db2 中Literal Replacement怎么理解,一直不明白,能否举例说明。