您的位置:首页 > 数据库 > Oracle

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

2012-02-17 21:52 4383 查看
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:

Create the missing datatype in ODI Topology Manager.
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



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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: