Discussion:
Making undefined defined data types (UDT), how do you do it?
(too old to reply)
c***@us.ibm.com
2007-09-11 20:32:09 UTC
Permalink
Hello everyone.

I'm trying to make a undefined data type (UDT) in DB2 v8.2
but there seems to be an error at line 3 it says.

CREATE SCHEMA"M";

CREATE DISTINCT TYPE OBJECTLINK AS DECIMAL (9,2);

CREATE TABLE "M".
"agent"
(
"aIndMACAddress"
OBJECTLINK
,
"EventCorrelator"
VARCHAR(1024)
..
...

Any ideas on the syntax or what I'm doing wrong? I'm putting this in the .ddl and loading it with Rational Software Architect.
Stephan Arenswald
2007-09-12 20:09:15 UTC
Permalink
Post by c***@us.ibm.com
Hello everyone.
I'm trying to make a undefined data type (UDT) in DB2 v8.2
but there seems to be an error at line 3 it says.
CREATE SCHEMA"M";
CREATE DISTINCT TYPE OBJECTLINK AS DECIMAL (9,2);
CREATE TABLE "M".
"agent"
(
"aIndMACAddress"
OBJECTLINK
,
"EventCorrelator"
VARCHAR(1024)
..
...
Any ideas on the syntax or what I'm doing wrong? I'm putting this in the .ddl and loading it with Rational Software Architect.
Hello,

according to the SQL reference you have to add WITH COMPARISONS to the
statement. Thus it will look like this:

CREATE DISTINCT TYPE OBJECTLINK AS DECIMAL (9,2) WITH COMPARISONS;

WITH COMPARISONS defines that there are some default comparison
functions are created to compare two instances of the type OBJECTLINK.

Hope this works

Loading...