Example: Assignments involving UDTs
Suppose that you want to store the form that is filled out by a new applicant into the database.
You have defined a host variable containing the character string value used to represent the filled form:
EXEC SQL BEGIN DECLARE SECTION;
SQL TYPE IS CLOB(32K) hv_form;
EXEC SQL END DECLARE SECTION;
/* Code to fill hv_form */
EXEC SQL
INSERT INTO APPLICATIONS
VALUES (134523, 'Peter Holland', CURRENT DATE, :hv_form); You do not explicitly invoke the cast function to convert the character string to the UDT
personal.application_form. This is because Db2® allows you to assign instances of the source type of a UDT to targets having that UDT.