Skip to Main Content

Java and JavaScript in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-24345 inserting values from Java source

roaldxJan 22 2002
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????
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 20 2002
Added on Jan 22 2002
2 comments
444 views