Francisco Morosini wrote:
 
> 2- When i try to make a ref. integrity between 2 tables :
>       table 1 c00 with 
> NAME DATATYPE DIM    CODE KEY NOTNULL DEFAULT       UNIQUE
> IID   Fixed     10,0         x      x    SERIAL(1)    
> 
> and the table L00 with 
> 
> NAME DATATYPE DIM    CODE KEY NOTNULL DEFAULT       UNIQUE
> CIID  Fixed     10,0         x      x    SERIAL(1)    
> 
> then in the ref. integrity dialog of alter table of L00 i create:
> FOREIGN KEY NAME  REFERENCING COLUMNS REFERENCE  ON DELETE  COMMENT
> minombre              CIID            DBA.C00->IID
> 
> i obtain:
> Unexpected Error:
> Module: SqlStudio.RefIntegrityDefinitionControl
> Function: loadColumnTypes
> Error No: 9
> Error: The SubIndex is out of the interval
> 
> later:
> Wrong Column Length
> The datatype and length of referencing  and referenced 
> columns must be the
> same
> 

It seems a little bit strange what you are trying to do.
You want to assure that both serials walk in parallel ?
That means, you want the same number to be used in both tables
if inserting the corresponding rows?
If every insert of the rows in both tables does not work, your serials
will be not in parallel any more.

Why don't you use a sequence and use 
insert into c00 (..., seq.NEXTVAL,...)
insert into l00  (..., seq.CURRVAL,...) ?
Then you can be sure that after insert the referential constraint (if needed
any more)
will be fulfilled. Ans everything will be fine even if one insert will not
work for any reason.

BTW: if you expect for each row in one table exactly one row in the other
table,
         why is it not just one table with all info in?

With error No 9 I hope, another guy has any idea.

Elke
SAP Labs Berlin


_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to