Editing nonversioned geodatabase data in Informix using SQL

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 object ID (row ID) column. When you use SQL to insert records into nonversioned tables in the geodatabase, you must provide a unique value for the object ID.

This set of instructions describes updating one row at a time. You would most likely write a routine or client program to retrieve object IDs and update your data.

Steps:
  1. Log into the database from a SQL editor, such as I-SQL.

    Be sure to log in to the database as a user who has permission to edit the data.

  2. Query the table_registry table to find the registration ID and owner of the table into which you want to insert a row.

    In this example, the registration ID and owner name for the factories table is returned.

    SELECT owner,registration_id,table_name
    FROM sde.table_registry
    WHERE table_name='factories';
    
    owner    registration_id    table_name
    editor1         7           factories
  3. Log in to execute the next_row_id function and get the next available row ID value.
  4. Execute the next_row_id function. This function is owned by the sde user.

    In this example, editor1 is the table owner, and 7 is the registration ID of the factories table.

    EXECUTE FUNCTION "sde".next_row_id('editor1',7);
    
    ret_code 0
    err_msg
    rowid 18
    
    1 row(s) retrieved.

  5. Go back to the SQL editor and insert a record to the table.
    INSERT INTO factories
    VALUES (
    18,
    'makem'
    ST_PolyFromText('POLYGON((52 18,66 23,73 9,48 6,52 18),(59 18,67 18,67 13,59 13,59 18))',101)
    );

Related Topics


2/5/2013