Skip to Main Content
  • Questions
  • Is it possible to use occi client of oracle11 to fetch/write extended data types that were added in oracle 12c?

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Oleksii.

Asked: August 23, 2016 - 11:17 pm UTC

Last updated: August 24, 2016 - 1:05 am UTC

Version: 12c

Viewed 1000+ times

You Asked

Hi,

I use oracle11 client library (libocci.so.11.1) to work with extended data types, like RAW(32000), VARCHAR(32000), etc.
This is a new feature of Oracle 12c.
When I try to fetch RAW data, I get exception:
ORA-01461: can bind a LONG value only for insert into a LONG column
however I don't use long data at all.

My table:
CREATE TABLE my_table_name
block_id NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY PRIMARY KEY,"
block_segment BINARY_DOUBLE,
block_offset BINARY_DOUBLE,
compression_type NUMBER(2),
block_type NUMBER(2),
block_small_data RAW(32000),
block_big_data BLOB);

Insert statement:
INSERT INTO my_table_name
(block_small_data, compression_type, block_segment, block_offset, block_big_data, block_type)
VALUES (:data, :compression, :segment, :offset, empty_blob(), 1);

Bindings:
Bytes byte_block(block->data().buffer(), block->data().compressedSize(), 0);
statement->setBytes(1, byte_block);
statement->setInt(2, block->data().compressionType());
statement->setDouble(3, block->key().getSegment());
statement->setDouble(4, block->key().getOffset());
statement->executeUpdate();

and Connor said...

I would be very surprised if the 11 client will copy. For example, even just from database to database

--
-- v12
--
SQL> create table t ( x varchar2(32000));

Table created.

SQL>
SQL> insert into t values (rpad('x',25000,'x'));

1 row created.

SQL> commit;

Commit complete.

--
-- and now access from v11
--
SQL> select * from t@np12;
select * from t@np12
*
ERROR at line 1:
ORA-24920: column size too large for client
ORA-02063: preceding line from NP12



You would need to use the 12c client.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

CLOB/BLOB/etc

Complete documentation on Securefiles and Large Objects here