You can use SQL to update, insert data into, and delete data from nonversioned tables in the geodatabase if they do not participate in geodatabase behavior. See What type of data can be edited using SQL? for information on the types of data and geodatabase behavior you cannot edit with SQL.
All data that is registered with the geodatabase has a system-maintained, unique, not-null ObjectID (Row ID) field. When you use SQL to insert records into nonversioned tables in the geodatabase, you must provide a unique value for the ObjectID. You can use the Next_RowID stored procedure to insert a value to the ObjectID field using SQL.
Use the Next_RowID function from the sde.gdb_util package to generate a new, unique value for the ObjectID.
The Next_RowID function uses two parameters: table owner and table name. With the table owner and table name, an SQL statement can be created to populate the ObjectID field.
- Log in to the database from an SQL editor such as SQL*Plus.
Be sure to log in to the database as a user who has permission to edit the data.
- Include the sde.gdb_util.next_rowid function with the owner and table names in the INSERT statement to insert the next available value into the ObjectID field.
In this example, an ST_Geometry line segment is inserted in the STREAMS feature class.
INSERT INTO eng2.streams (OBJECTID,NAME,SHAPE) VALUES ( sde.gdb_util.next_rowid('ENG2', 'STREAMS'), 'TRANQUIL', sde.ST_GEOMETRY('linestring (750 150, 750 750)', 4326) );
- You can continue editing or, if you are done editing, commit your edits to the database.
If the table also contains a GUID or Global ID field, you must provide a unique value for this field as well. See Next_GlobalID for more information.