Inserting data into data source objects

To insert data into data sources, use the nicknames for the data source objects in the INSERT statement.

Before you begin

To insert data using a nickname, all of the following privileges must be true:
  • The privileges held by the authorization ID of the statement must include the INSERT privilege on the nickname (for the federated database to accept the request).
  • The user ID at the data source must have the INSERT privilege on the underlying table object (for the data source to accept the request).
  • The user ID at the data source must be mapped to the authorization ID at the federated server through a user mapping.

About this task

Restrictions

Federation does not support INSERT operations with non-relational data sources.

Procedure

Issue the INSERT statement to insert data into data source objects.

Example

An Informix® table consists of two columns. The first column contains INTEGER data and the second column contains VARCHAR data (up to 20 characters). The nickname infx_table_nn is registered with the federated server for the Informix table.

You can issue INSERT, UPDATE, and DELETE statements on the Informix table using the infx_table_nn nickname. The following statement inserts a new row of information into the Informix table:
INSERT INTO db2user1.infx_table_nn VALUES(1,'Walter')