Class PlsqlIndexByTable
java.lang.Object
com.mcpdbwizard.pub.PlsqlIndexByTable
Holds state variables for PL/SQL Index By Table parameters
This class represents an Oracle PL/SQL Index By Table. In addition to the table data it also holds information about the data type of the elements in the table, their maximum length and the maximum number of elements this table can have after an update or retrieval. For this reason this class is always instantiated even for OUT parameters. As of Oracle 10g INDEX BY tables can have two types of parameters - Numbers or Strings. Parameter types can not be mixed within the same table.
Under normal circumstances MCPDBWizard users will have no reason to use this class directly - the generated code will use it.
Copyright 2003-2026 ATB Consultancy Services Ltd (formerly Orinda Software Ltd, Dublin, Ireland)
- Since:
- Oracle 10g/4.0.1798
- Version:
- 7
- Author:
- [email protected]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObject[]getArray()Get the array dataGet the array data as java.math.BigDecimal[] This convenience method returns the contents of the array as an array of BigDecimal.double[]getArrayAsDouble(double nullToken) Get the array data as double[] This convenience method returns the contents of the array as an array of double.float[]getArrayAsFloat(float nullToken) Get the array data as float[] This convenience method returns the contents of the array as an array of float.int[]getArrayAsInt(int nullToken) Get the array data as int[] This convenience method returns the contents of the array as an array of int.long[]getArrayAsLong(long nullToken) Get the array data as long[] This convenience method returns the contents of the array as an array of long.String[]Get the array data as String[] This convenience method returns the contents of the array as an array of String.intGet the length of the arrayintGet the underlying OracleType code for the array.intGet the maximum size this table can be after an update or retrieval.intGet the maximum length of an element in the tablevoidsetArray(double[] newArray) Set the array data using double[] This convenience method returns sets the array using an array of double[]voidsetArray(float[] newArray) Set the array data using float[] This convenience method returns sets the array using an array of float[]voidsetArray(int[] newArray) Set the array data using int[] This convenience method returns sets the array using an array of int[]voidsetArray(long[] newArray) Set the array data using long[] This convenience method returns sets the array using an array of long[]voidSet the contents of the Array.voidSet the data type to NumbersvoidSet the data type to StringsvoidsetElementMaxCount(int elementMaxCount) Set the maximum size this table can be after an update or retrieval.voidsetElementMaxLength(int elementMaxLength) Set the maximum length of an element in the table
-
Constructor Details
-
PlsqlIndexByTable
public PlsqlIndexByTable()Contruct an empty INDEX BY table
-
-
Method Details
-
getElementMaxLength
public int getElementMaxLength()Get the maximum length of an element in the table -
setElementMaxLength
public void setElementMaxLength(int elementMaxLength) Set the maximum length of an element in the table -
getElementMaxCount
public int getElementMaxCount()Get the maximum size this table can be after an update or retrieval. -
setElementMaxCount
public void setElementMaxCount(int elementMaxCount) Set the maximum size this table can be after an update or retrieval. This is used to decide how big the output array should be. -
setDataTypeString
public void setDataTypeString()Set the data type to Strings -
setDataTypeNumber
public void setDataTypeNumber()Set the data type to Numbers -
getDataTypeCode
public int getDataTypeCode()Get the underlying OracleType code for the array. This is determined by looking at the first element in the array. -
getArray
Get the array data -
setArray
Set the contents of the Array. This method assumes that the user is providing a 1 dimensional array of numbers or strings. The values of elementMaxCount and elementMaxLength are updated by this method. If you are passing in an array that will be appended and returned to you you should call setElementMaxCount and setElementMaxLength after calling serArray. 'null' is not an acceptable value for dataArray and will be turned into Object[0]. This is so that getArrayLength works reliably.- Parameters:
dataArray-- See Also:
-
setArray
public void setArray(int[] newArray) Set the array data using int[] This convenience method returns sets the array using an array of int[]- Parameters:
newArray-
-
setArray
public void setArray(long[] newArray) Set the array data using long[] This convenience method returns sets the array using an array of long[]- Parameters:
newArray-
-
setArray
public void setArray(float[] newArray) Set the array data using float[] This convenience method returns sets the array using an array of float[]- Parameters:
newArray-
-
setArray
public void setArray(double[] newArray) Set the array data using double[] This convenience method returns sets the array using an array of double[]- Parameters:
newArray-
-
getArrayAsInt
public int[] getArrayAsInt(int nullToken) Get the array data as int[] This convenience method returns the contents of the array as an array of int. Because the array can have null elements and an 'int' can never be null you need to say how nulls should be treated.- Parameters:
nullToken- The int you will use to represent null. e.g. Integer.MIN_VALUE- Returns:
- int[] An array of numbers. If the array is empty you will get int[0] back.
- Throws:
ClassCastException- if the array isn't of numbers.
-
getArrayAsLong
public long[] getArrayAsLong(long nullToken) Get the array data as long[] This convenience method returns the contents of the array as an array of long. Because the array can have null elements and a 'long' can never be null you need to say how nulls should be treated.- Parameters:
nullToken- The long you will use to represent null. e.g. Long.MIN_VALUE- Returns:
- long[] An array of numbers. If the array is empty you will get long[0] back.
- Throws:
ClassCastException- if the array isn't of numbers.
-
getArrayAsFloat
public float[] getArrayAsFloat(float nullToken) Get the array data as float[] This convenience method returns the contents of the array as an array of float. Because the array can have null elements and a 'float' can never be null you need to say how nulls should be treated.- Parameters:
nullToken- The float you will use to represent null. e.g. Float.MIN_VALUE- Returns:
- float[] An array of numbers. If the array is empty you will get float[0] back.
- Throws:
ClassCastException- if the array isn't of numbers.
-
getArrayAsDouble
public double[] getArrayAsDouble(double nullToken) Get the array data as double[] This convenience method returns the contents of the array as an array of double. Because the array can have null elements and a 'double' can never be null you need to say how nulls should be treated.- Parameters:
nullToken- The double you will use to represent null. e.g. Double.MIN_VALUE- Returns:
- double[] An array of numbers. If the array is empty you will get double[0] back.
- Throws:
ClassCastException- if the array isn't of numbers.
-
getArrayAsString
Get the array data as String[] This convenience method returns the contents of the array as an array of String. Because the array can have null elements and an 'double' can never be null you need to say how nulls should be treated.- Returns:
- String[] An array of Strings. If the array is empty you will get double[0] back.
-
getArrayAsBigDecimal
Get the array data as java.math.BigDecimal[] This convenience method returns the contents of the array as an array of BigDecimal.- Returns:
- BigDecimal[] An array of BigDecimal
- Throws:
CSException- if this isn't an array of numbers- Since:
- 4.0.2108
-
getArrayLength
public int getArrayLength()Get the length of the array
-