Using Oracle Large Object (LOB) Datatype Columns In ODI Integration Interfaces [ID 423768.1]

 
Using Oracle Large Object (LOB) Datatype Columns In ODI Integration Interfaces [ID 423768.1]

 Modified 21-NOV-2011 Type PROBLEM Status PUBLISHED 

In this Document
Symptoms
Cause
Solution
References


Applies to:

Oracle Data Integrator - Version: 3.2.03.01 and later [Release: 3.2.03 and later ]
Information in this document applies to any platform.

Symptoms

The following message:
java.sql.SQLException: ORA-00932: inconsistent datatypes
is signaled when executing an interface based on Oracle technology.

Remark: One of the mapped columns has a CLOB type in both source, staging area and target data sources.

Cause

Oracle provides the following LOB types:
  • BLOB, used to store binary data.
  • CLOB, used to store character data using the database character set encoding.
  • NCLOB, used to store Unicode character data using the national character set.
  • BFILE, used to reference external files under the operating system's filesystem.
  • Older versions of Oracle provided LONG and LONG RAW types for character and binary data, respectively. With Oracle9i these were deprecated in favor of LOBs.
See Oracle Database Application Developer's Guide - Large Objects for details, use and restrictions.

For example, the following operations are invalid:

- SELECT lobcol from table1@remote_site;
- INSERT INTO lobtable select type1.lobattr from table1@remote_site;
- SELECT dbms_lob.getlength(lobcol) from table1@remote_site;


Solution

A number of restrictions apply to the use of LOB types, the most important being their use in SQL statements.

You cannot use a LOB type in any of the following queries:
  • SELECT DISTINCT <lob_type>
  • ORDER BY <lob_type>
  • GROUP BY <lob_col>
It is also illegal to use a LOB type column for:
  • Table joins,
  • UNION,
  • INTERSECTION and
  • MINUS statements.
Further restrictions apply to other aspects of the use of LOBs, such as you cannot use LOB as a primary key column.

Also:
  • When binding an internal LOB in order to use piece-wise INSERT/UPDATE, the bind variable may be of type SQLT_CHR or SQLT_LBI but is limited to 4k. You cannot bind a SQLT_LNG to a LOB or a SQLT_LBI that is longer than 4k.
  • LOBs are not allowed in clustered tables and thus cannot be a cluster key.
  • LOBs are not allowed in VARRAYs.
  • NCLOBs are not allowed as attributes in object types but NCLOB parameters are allowed in methods.
  • LONGs are not allowed in WHERE clause, expressions, aggregates, function calls and Indexes. See Note.423992.1 <Using Oracle LONG Datatype Columns In ODI(Sunopsis)> for details.

Q: What to do if the desired LOB datatype is not defined in ODI Topology?

A: Manually define the missing datatype as shown in Note 424012.1 <How Can I Define (New) Datatypes In ODI Topology?>.

Note that, due to a missing datatype, the underlying Datastore may have been incorrectly reverse engineered and the LOB Column type left blank (NULL). In this case:
  1. Create the missing datatype in ODI Topology Manager.
  2. Reverse engineer the Model / Datastore again.


I M P O R T A N T:

Under some conditions, the use of LONG and LOB datatypes from ODI Integration Interfaces may not work as expected, even if Oracle-dedicated Knowledge Modules provided with ODI 10.1.3.5 are used.

For example, if the LOB field contains many bytes of data, the execution of the Integration Interface may show the following message:
java.lang.ClassCastException: java.lang.String
at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7846)
at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7546)
at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:7919)
at com.sunopsis.sql.SnpsQuery.updateExecStatement(SnpsQuery.java)

The behavior is resolved in version 10.1.3.5.6 of ODI. For details, refer to:
Bug 6870772 WHEN USING LKM SQL TO SQL TO LOAD BLOB AND CLOB DATA WITH ORACLE



References

http://www.oracle.com/technology/pub/articles/oracle_php_cookbook/fuecks_lobs.html
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14249/toc.htm
http://rocksolutions.wordpress.com/2010/06/07/handling-clobs-made-easy-with-oracle-jdbc-10g/
http://www.oracle.com/technetwork/indexes/samplecode/index.html
NOTE:423992.1 - Using Oracle LONG Datatype Columns In ODI
NOTE:424658.1 - "ORA-00942" Message With Oracle Large Object (LOB) Datatype Fields In ODI Integration Interfaces
NOTE:424012.1 - How Can I Define (New) Datatypes In ODI Topology?
NOTE:423909.1 - "java.lang.NumberFormatException" Or "Cannot start execution" Or "om.sunopsis.jdbc.driver.file.d.i" Signaled When Using Oracle LOB Family Column Types In ODI Datastores And Integration Interfaces
BUG:6870772 - WHEN USING LKM SQL TO SQL TO LOAD BLOB AND CLOB DATA WITH ORACLE

Show Related Information Related


Products
  • Middleware > Data Integration > Oracle Data Integrator (ODI) > Oracle Data Integrator
Keywords
BFILE; BLOB; CLOB; DATATYPE; KNOWLEDGE MODULES; LOB; ODI; ORACLE DATA INTEGRATOR; ORACLEPREPAREDSTATEMENT; SUNOPSIS
Errors
ORA-932

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值