title: Insert data into a column with user defined datatype in DB2
body: <p>I created a user defined datatype using the following query</p>
  <pre><code>CREATE TYPE test3.data_type1 AS
  (xmldata clob(204800) logged NOT compact)
  INSTANTIABLE
  inline LENGTH 195
  MODE DB2SQL;
  </code></pre>
  <p>I then created a table using the following query:</p>
  <pre><code>CREATE TABLE test3.test_table
  (col1 varchar(256),
  col2 test3.data_type1,
  col3 varchar(254),
  col4 varchar(128),
  col5 varchar(128) WITH DEFAULT USER,
  col6 timestamp WITH DEFAULT,
  col7 varchar(128),
  col8 timestamp)
  ;
  </code></pre>
  <p>I am now trying to insert data into this table, test_table using:</p>
  <pre><code>INSERT INTO test3.test_table (col2)
  VALUES
  (data_type1('aaaa'));
  </code></pre>
  <p>The error I get is as follows:</p>
  <pre><code>SQL Error [42884]: No authorized routine named &quot;DATA_TYPE1&quot; of type &quot;FUNCTION&quot; having compatible arguments was found.. SQLCODE=-440, SQLSTATE=42884, DRIVER=4.26.14
  </code></pre>
  <p>I also tried multiple options of this insert statement but with no luck. I also tried creating a function as mentioned in this post <a href="https://stackoverflow.com/questions/37461096/insert-into-db2-with-a-user-defined-type-column">INSERT into DB2 with a user defined type column</a>
  But, I get an error while creating this function as well. Here is the function as per this post :</p>
  <pre><code>CREATE FUNCTION data_type1 (xmldata clob(204800)) 
  RETURNS data_type1
  BEGIN ATOMIC 
      DECLARE t data_type1;
      SET t = data_type1();
      SET t..xmldata = xmldata;
      RETURN t;
  END
  
  </code></pre>
  <p>The error I get with this is as follows:</p>
  <pre><code>SQL Error [42704]: &quot;DATA_TYPE1&quot; is an undefined name.. SQLCODE=-204, SQLSTATE=42704, DRIVER=4.26.14
  </code></pre>
  <p>DB2 version - 11.5 LUW
  Any pointers in the right direction would help.</p>