The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > java.sql  [73 examples] > Oracle VARRAYs  [4 examples]

e302. Inserting a VARRAY Value into an Oracle Table

This example inserts a row with a VARRAY as defined in e301 Creating a VARRAY Type in an Oracle Database.
    try {
        // Create a statement
        Statement stmt = connection.createStatement();
    
        // Insert a row with an array of two values
        stmt.execute ("INSERT INTO varray_table VALUES(number_varray(123, 234))");
    } catch (SQLException e) {
    }

 Related Examples
e301. Creating a VARRAY Type in an Oracle Database
e303. Inserting a VARRAY Value into an Oracle Table Using a Prepared Statement
e304. Getting a VARRAY Value from an Oracle Table

See also: Batching    Connections    Database Meta Data    Deleting Data    Drivers    Importing and Exporting    Inserting and Updating Data    Oracle OBJECTs    Procedures and Functions    Retrieving Data    Scrollable Result Sets    Tables    Updatable Result Sets   


© 2002 Addison-Wesley.