A script-enabled browser is required for this page to function properly.

ORA_JAVA.NEW_java_type_ARRAY

This function creates a new array of the specified Java type.

Syntax

FUNCTION ORA_JAVA.NEW_OBJECT_ARRAY (
 length IN PLS_INTEGER,
 clsname IN VARCHAR2)
RETURN ORA_JAVA.JARRAY;

FUNCTION ORA_JAVA.NEW_BYTE_ARRAY (
 length IN PLS_INTEGER)
RETURN ORA_JAVA.JARRAY;

FUNCTION ORA_JAVA.NEW_CHAR_ARRAY (
 length IN PLS_INTEGER)
RETURN ORA_JAVA.JARRAY;

FUNCTION ORA_JAVA.NEW_SHORT_ARRAY (
 length IN PLS_INTEGER)
RETURN ORA_JAVA.JARRAY;

FUNCTION ORA_JAVA.NEW_INT_ARRAY (
 length IN PLS_INTEGER)
RETURN ORA_JAVA.JARRAY;

FUNCTION ORA_JAVA.NEW_LONG_ARRAY (
 length IN PLS_INTEGER)
RETURN ORA_JAVA.JARRAY;

FUNCTION ORA_JAVA.NEW_FLOAT_ARRAY (
 length IN PLS_INTEGER)
RETURN ORA_JAVA.JARRAY;

FUNCTION ORA_JAVA.NEW_DOUBLE_ARRAY (
 length IN PLS_INTEGER)
RETURN ORA_JAVA.JARRAY;

FUNCTION ORA_JAVA.NEW_STRING_ARRAY (
 length IN PLS_INTEGER)
RETURN ORA_JAVA.JARRAY;

FUNCTION ORA_JAVA.NEW_BOOLEAN_ARRAY (
 length IN PLS_INTEGER)
RETURN ORA_JAVA.JARRAY;

Parameters

Description

length

Size of the array to be created (i.e., the number of array elements).

clsname

Fully qualified name of the class file. Use '.' (period) as separators in the name, e.g., java.lang.String.

Required only when creating an array of the Object data type.

Returns

An object of the PL/SQL type ORA_JAVA.JARRAY, which is a subtype of ORA_JAVA.JOBJECT.

Usage notes

See Working with Arrays for additional information.

Examples

/*
** Example of creating an array of data type object.
*/

PROCEDURE create_object_array IS
 arr ORA_JAVA.JOBJECT;
BEGIN
 arr := ORA_JAVA.NEW_OBJECT_ARRAY(3, 'java.lang.String');
 ...
END;

/*
** Example of creating an array of data type char with one element.
*/

PROCEDURE create_char_array IS
 arr ORA_JAVA.JOBJECT;
BEGIN
 arr := ORA_JAVA.NEW_CHAR_ARRAY(1);
 ...
END;

See also

Working with Arrays

ORA_JAVA.GET_java_type_ARRAY_ELEMENT

ORA_JAVA.SET_java_type_ARRAY_ELEMENT

ORA_JAVA.GET_ARRAY_LENGTH