Home | Previous Page | Next Page   Modifying Data > Inserting Rows >

Inserting Smart Large Objects (IDS)

When you use the INSERT statement to insert an object into a BLOB or CLOB column, the database server stores the object in an sbspace, rather than the table. The database server provides SQL functions that you can call from within an INSERT statement to import and export BLOB or CLOB data, otherwise known as smart large objects. For a description of these functions, see page Smart-Large-Object Functions (IDS).

The following INSERT statement uses the filetoblob() and filetoclob() functions to insert a row of the inmate table. (Figure 216 defines the inmate table.)

INSERT INTO inmate
   VALUES (437, FILETOBLOB('datafile', 'client'), 
      FILETOCLOB('tmp/text', 'server'))

In the preceding example, the first argument for the FILETOBLOB() and FILETOCLOB() functions specifies the path of the source file to be copied into the BLOB and CLOB columns of the inmate table, respectively. The second argument for each function specifies whether the source file is located on the client computer ('client') or server computer ('server'). To specify the path of a filename in the function argument, apply the following rules:

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]