ORA-24345 inserting values from Java source
RDBMS version:
Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
With the Partitioning option
JServer Release 8.1.7.0.0 - Production
My problem is described by the following test code:
/*****************************************/
TEST TABLE:
/*****************************************/
create table RAW1
(
ID NUMBER,
IMG LONG RAW
)
/*****************************************/
Java source
/*****************************************/
create or replace and compile java source named test as
public
class test
{
public static oracle.sql.RAW make_raw( int length )
throws java.sql.SQLException
{
byte[] buffer= new byte[length];
for ( int i = 0 ; i < length ; ++i )
buffer[i] = 124;
return new oracle.sql.RAW( buffer );
}
}
/*****************************************/
Function definition
/*****************************************/
create or replace function test_make_raw( length number )
return long raw as
language java
name 'test.make_raw( int ) return oracle.sql.RAW';
/*****************************************/
Successful insertion:
/*****************************************/
insert into raw1 values (2000 , test_make_raw(2000 ) );
commit;
/*****************************************/
Unsuccessful insertion:
/*****************************************/
insert into raw1 values (2001 , test_make_raw(2001 ) );
commit;
/*****************************************/
Error as reported from SQL*Plus
/*****************************************/
ERROR:
ORA-24345: A Truncation or null fetch error occurred
SP2-0642: SQL*Plus internal error state 2087, context 2:0:0
Unsafe to proceed
/*****************************************/
Any ideas????