The "problem" I had with control center was I could not find the way to
define a UNIQUE constraint as I can creating the table via a script in a
single statement.
Anyway, the problem with my script was the wrong syntax I was using.
Saludos
Horacio Villa
TTI S.A.
-----Mensaje original-----
De: [EMAIL PROTECTED] En nombre de Juan Lanus
Enviado el: Domingo 8 de Julio de 2001 00:17
Para: [EMAIL PROTECTED]
Asunto: Re: DB2EUG: Create table failing
Horacio:
One easy way is to create the tables using the control center and then
to run db2look to produce the DDL script needed to create the tables.
The db2look scritp may include also the granted permissions.
Saludos
--
Juan Lanus
TECNOSOL
Villa Horacio wrote:
> Hi,
> I get an error running the following script:
>
> CREATE TABLE cd_actas (
> cdcaja CHAR(10) NOT NULL,
> cdnro CHAR(8) NOT NULL,
> cdfechagrabado DATE NOT NULL,
> cdfechaingreso TIMESTAMP NOT NULL,
> constraint xpkcd_actas primary key (cdnro),
> constraint xak1cd_actas unique (cdcaja, cdnro))
> data capture none
> in userspace1;
>
> CREATE TABLE grupo (
> grpcod CHAR(8) NOT NULL,
> grpdes VARCHAR(35) NOT NULL,
> constraint xpkgrupo primary key (grpcod))
> data capture none
> in userspace1;
>
> CREATE TABLE usuario (
> usucod VARCHAR(15) NOT NULL,
> usudes VARCHAR(35) NOT NULL,
> usupwd VARCHAR(15) NOT NULL,
> grpcod CHAR(8) NOT NULL,
> constraint xpkusuario primary key (usucod),
> constraint xfgusuario references grupo (grpcod)
> on delete restrict
> on update no action)
> data capture none
> in userspace1;
>
> CREATE TABLE acta (
> actcod CHAR(10) NOT NULL,
> acttipo CHAR(1) NOT NULL,
> actfmtimagen CHAR(3) NOT NULL,
> cdnro CHAR(8) NOT NULL,
> actimagen BLOB(128K) NOT NULL not logged not compact,
>
> constraint xpkacta primary key (actcod),
> constraint xak1acta unique (cdnro, actcod),
> constraint xfg1acta references cd_actas (cdnro)
> on delete restrict
> on update no action)
> data capture none
> in userspace2
> index in userspace2
> long in longspace1;
>
> The first two create tables go well, but the 3rd. & 4th. are in error.
Why?
>
> 06/07/2001 14:38:02 CREATE TABLE usuario ( usucod VARCHAR(15)
> NOT NULL, usudes VARCHAR(35) NOT NULL, usupwd
> VARCHAR(15) NOT NULL, grpcod CHAR(8) NOT NULL, constraint
> xpkusuario primary key (usucod), constraint xfgusuario references grupo
> (grpcod) on delete restrict on update no action) data capture none in
> userspace1
> 06/07/2001 14:38:02 DB21034E The command was processed as an SQL
statement
> because it was not a valid Command Line Processor command. During SQL
> processing it returned:
> 06/07/2001 14:38:02 SQL0104N An unexpected token "constraint" was found
> following "rimary key (usucod),". Expected tokens may include:
> "<col_name>". SQLSTATE=42601
>
> 06/07/2001 14:38:02 CREATE TABLE acta ( actcod CHAR(10) NOT
> NULL, acttipo CHAR(1) NOT NULL, actfmtimagen CHAR(3)
NOT
> NULL, cdnro CHAR(8) NOT NULL, actimagen BLOB(128K)
> NOT NULL not logged not compact, constraint xpkacta primary key (actcod),
> constraint xak1acta unique (cdnro, actcod), constraint xfg1acta references
> cd_actas (cdnro) on delete restrict on update no action) data capture none
> in userspace2 index in userspace2 long in longspace1
> 06/07/2001 14:38:02 DB21034E The command was processed as an SQL
statement
> because it was not a valid Command Line Processor command. During SQL
> processing it returned:
> 06/07/2001 14:38:02 SQL0104N An unexpected token "constraint" was found
> following "que (cdnro, actcod),". Expected tokens may include:
> "<col_name>". SQLSTATE=42601
>
> TIA
> Horacio Villa
>
> =====
> To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
> For other info (and scripts), see
http://people.mn.mediaone.net/scottrmcleod
>
>
>
>
=====
To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
For other info (and scripts), see http://people.mn.mediaone.net/scottrmcleod
=====
To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
For other info (and scripts), see http://people.mn.mediaone.net/scottrmcleod