Inserting an OBJECT Value into an Oracle Table

This example inserts a row into a table with a column that contains an OBJECT type. The example uses the table and types created in Creating an OBJECT Type in an Oracle Database.
try { // Create a statement Statement stmt = connection.createStatement(); // Insert a row with values for both the object1 and object2 types stmt.execute("INSERT INTO object1_table VALUES(1, object1('str1', object2('obj2str1', 123)))"); } catch (SQLException e) { }

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.