Hi,

I have created my distinct type as

CREATE TYPE UDTOBJECT AS VARCHAR(40) WITH COMPARISONS

and my table SQL is

CREATE TABLE T_TEST_RESULT(
Id INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY ( START WITH 1, INCREMENT BY 1, NO CACHE ),
object UDTOBJECT,
Date TIMESTAMP DEFAULT CURRENT TIMESTAMP,
CONSTRAINT CC1263817423857 PRIMARY KEY(Id) )




The problem is that when I try to update the field of distinct type column using ADO, it throws an error.

Description = [DB2/NT] SQL0432N A parameter marker or null value cannot have the user defined type name or reference target type name "UDTOBJECT". SQLSTATE=42841


Here is my ADO code.


ADODB::_RecordsetPtr ipRec;
ipRec.CreateInstance( __uuidof(ADODB::Recordset) );

ipRec->CursorLocation = ADODB::adUseClient;

ipRec->Open( "SELECT * FROM T_TEST_RESULT WHERE Id = 1",
(IDispatch *)ipConn,
ADODB::adOpenStatic,
ADODB::adLockOptimistic,
ADODB::adCmdUnknown );


if( (ipRec->BOF == VARIANT_TRUE) && (ipRec->EndOfFile == VARIANT_TRUE) )
{
printf( "No data....\n" );
return -1;
}


_variant_t vObject( "Hello World" );

ipRec->Fields->Item["object"]->Value = vObject;
ipRec->Update();



Any help will be highly appreciated.

Thanks in advance.

Regards.