![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e301. Creating a VARRAY Type in an Oracle DatabaseA VARRAY is a variable-length ordered list of values of one type. This example creates a VARRAY that can hold up to ten NUMBER values.try { Statement stmt = connection.createStatement(); // Create a 10-element VARRAY of NUMBERs stmt.execute("CREATE TYPE number_varray AS VARRAY(10) OF NUMBER(12, 2)"); // Create a table with a column to hold the new VARRAY type stmt.execute("CREATE TABLE VARRAY_TABLE(col_number_array number_varray)"); } catch (SQLException e) { }
e303. Inserting a VARRAY Value into an Oracle Table Using a Prepared Statement e304. Getting a VARRAY Value from an Oracle Table © 2002 Addison-Wesley. |