ORA_JAVA.SET_java_type_ARRAY_ELEMENT
built-in procedureThis procedure changes the value of a given element in a given array of the specified Java type to a given value.
PROCEDURE ORA_JAVA.SET_OBJECT_ARRAY_ELEMENT (
arr IN ORA_JAVA.JARRAY,
pos IN PLS_INTEGER,
value IN ORA_JAVA.JOBJECT);
PROCEDURE ORA_JAVA.SET_BYTE_ARRAY_ELEMENT (
arr IN ORA_JAVA.JARRAY,
pos IN PLS_INTEGER,
value IN PLS_INTEGER);
PROCEDURE ORA_JAVA.SET_CHAR_ARRAY_ELEMENT (
arr IN ORA_JAVA.JARRAY,
pos IN PLS_INTEGER,
value IN PLS_INTEGER);
PROCEDURE ORA_JAVA.SET_SHORT_ARRAY_ELEMENT (
arr IN ORA_JAVA.JARRAY,
pos IN PLS_INTEGER,
value IN PLS_INTEGER);
PROCEDURE ORA_JAVA.SET_INT_ARRAY_ELEMENT (
arr IN ORA_JAVA.JARRAY,
pos IN PLS_INTEGER,
value IN NUMBER);
PROCEDURE ORA_JAVA.SET_LONG_ARRAY_ELEMENT (
arr IN ORA_JAVA.JARRAY,
pos IN PLS_INTEGER,
value IN NUMBER);
PROCEDURE ORA_JAVA.SET_FLOAT_ARRAY_ELEMENT (
arr IN ORA_JAVA.JARRAY,
pos IN PLS_INTEGER,
value IN NUMBER);
PROCEDURE ORA_JAVA.SET_DOUBLE_ARRAY_ELEMENT (
arr IN ORA_JAVA.JARRAY,
pos IN PLS_INTEGER,
value IN NUMBER);
PROCEDURE ORA_JAVA.SET_STRING_ARRAY_ELEMENT (
arr IN ORA_JAVA.JARRAY,
pos IN PLS_INTEGER,
value IN VARCHAR2);
PROCEDURE ORA_JAVA.SET_BOOLEAN_ARRAY_ELEMENT (
arr IN ORA_JAVA.JARRAY,
pos IN PLS_INTEGER,
value IN BOOLEAN);
Parameters |
Description |
|
A valid array of the specified type. The actual
parameter is the array of type |
|
Position of the element in the array to be replaced. Note that the position of the first element is always 0. For example, in an array of size 3, the positions of the elements are 0, 1, and 2. |
|
New value of the specified type to replace the array element. |
The array of the specified type and array element to be replaced must be valid.
If the length of the array is unknown, use ORA_JAVA.GET_ARRAY_LENGTH
to determine the size of the array first.
You can only set one value at a time
See Working with Arrays for additional information.
/*
** Example of changing 3 values of an array of data type object.
*/
PROCEDURE set_object_array IS
arr ORA_JAVA.JOBJECT;
obj ORA_JAVA.JOBJECT;
BEGIN
arr := ORA_JAVA.NEW_OBJECT_ARRAY(3, 'myapp.foo');
ORA_JAVA.SET_OBJECT_ARRAY_ELEMENT(arr, 0, foo.new('obj1'));
ORA_JAVA.SET_OBJECT_ARRAY_ELEMENT(arr, 1, foo.new('obj2'));
ORA_JAVA.SET_OBJECT_ARRAY_ELEMENT(arr, 2, foo.new('obj3'));
...
END;
/*
** Example of changing the value of an array of data type char.
*/
PROCEDURE set_char_array IS
arr ORA_JAVA.JOBJECT;
BEGIN
arr := ORA_JAVA.NEW_CHAR_ARRAY(1);
ORA_JAVA.SET_CHAR_ARRAY_ELEMENT(arr, 0, 2);
...
END;
ORA_JAVA.GET_java_type_ARRAY_ELEMENT
Copyright © 1984, 2005, Oracle. All rights reserved.