Book a Demo

Author Topic: Cannot reverse engineer compound foreign key  (Read 3241 times)

mshenga

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Cannot reverse engineer compound foreign key
« on: November 22, 2013, 09:41:54 am »
I have been trying to reverse engineer a Sybase ASA 9.0.2 database (yeah, I know it is old) using Enterprise Architect 10.0.1009. It imported tables and primary keys definitions just fine, but did not import the foreign keys! The database uses compount primary and foreign keys (don't ask me why!). The simplified example of the tables is below. In Settings->Database Datatypes I set "Sybase ASE" Product Name as the the default

Please help!
----------------------------------------------------
SET OPTION Statistics          = 3
go
SET OPTION Date_order          = 'YMD'
go
SET OPTION describe_java_format= 'binary'
go
SET OPTION PUBLIC.Preserve_source_format = 'OFF'
go
-------------------------------------------------
--   Create tables
-------------------------------------------------
CREATE TABLE "esquery"."Test_Table_A"
(
      "Column_A"                  numeric(30,6) NOT NULL ,
      "Column_B"                  numeric(30,6) NOT NULL ,
      "Table_A_Data"              varchar(10) NULL ,
       PRIMARY KEY ("Column_A", "Column_B"),
      
)
go
CREATE TABLE "esquery"."Test_Table_B"
(
      "Column_A"                  numeric(30,6) NOT NULL ,
      "Column_B"                  numeric(30,6) NOT NULL ,
      "Column_C"                  numeric(30,6) NOT NULL ,
      "Table_B_Data"              varchar(10) NULL ,
       PRIMARY KEY ("Column_A", "Column_B", "Column_C"),
      
)
go
commit work
go
-------------------------------------------------
--   Add foreign key definitions
-------------------------------------------------
ALTER TABLE "esquery"."Test_Table_B"
      ADD FOREIGN KEY "Test_Table_A" ("Column_A","Column_B")
      REFERENCES "esquery"."Test_Table_A" ("Column_A","Column_B")
go
commit work
go
« Last Edit: November 22, 2013, 09:42:22 am by mshenga »