IBM Books

SQL Reference

INSERT



>>-INSERT--(--expression1--,--expression2--,-------------------->
 
>----expression3--,--expression4--)----------------------------><
 

The schema is SYSFUN.

Returns a string where expression3 bytes have been deleted from expression1 beginning at expression2 and where expression4 has been inserted into expression1 beginning at expression2. If the length of the result string exceeds the maximum for the return type, an error occurs (SQLSTATE 38552).

The first argument is a character string or a binary string with a maximum length of 1048576 bytes. The second and third arguments must be a numeric value with a data type of SMALLINT or INTEGER. If the first argument is a character string, then the fourth argument must also be a character string with a maximum length of 1048576 bytes. If the first argument is a binary string, then the fourh argument must be a binary string with a maximum length of 1048576 bytes. For the first and fourth arguments, CHAR is converted to VARCHAR and LONG VARCHAR to CLOB(1M), for second and third arguments SMALLINT is converted to INTEGER for processing by the function.

The result is based on the argument types as follows:

The result can be null; if any argument is null, the result is the null value.

Example:


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

[ DB2 List of Books | Search the DB2 Books ]