I have a type on db2 like:
create type tipo_vehiculo as(
Descripcion varchar(30)
)MODE DB2SQL;
and have to create a table with pk, using the oid as pk doesn't work, so I try to create it on the table, but the IBM syntax doesn't work for me...
create table JORGEMONGE."tipo_vehiculo_t" of tipo_vehiculo(
"id_tipo_vehiculo_t" INT NOT NULL GENERATED ALWAYS AS IDENTITY ( START WITH 1 INCREMENT BY 1 MINVALUE -2147483648 MAXVALUE 2147483647 CACHE 20 ),
ref is oid user generated
);
An unexpected token "INTEGER" was found following "id_tipo_vehiculo_t". Expected tokens may include: "WITH OPTIONS".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.17.30
also tred:
create table JORGEMONGE."tipo_vehiculo_t" of tipo_vehiculo(
"id_tipo_vehiculo_t" INT WITH OPTIONS NOT NULL GENERATED ALWAYS AS IDENTITY ( START WITH 1 INCREMENT BY 1 MINVALUE -2147483648 MAXVALUE 2147483647 CACHE 20 ),
ref is oid user generated
);
but get:
An unexpected token "options" was found following "ehiculo integer with". Expected tokens may include: "".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.17.30
Any idea to set a pk on that typed table?