facebook

[Closed] Generate ERD does not show FK relationship

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #255835 Reply

    idfbins
    Member

    I have two tables with a foreign key relationship. See SQL below. The FBOrgClient table consists of two columns both of which comprise its primary key. column ORGClntID references table FBClient’s primary key. When I generate the ERD from the schema from MyEclipse DB Explorer the relationship between these two tables is not shown. Is this a bug in DB explorer, or am I doing something wrong.

    SQL:

    
    CREATE TABLE NXSDVPDTA.FBORGCLIENT ( 
        ORGCLNTID INTEGER NOT NULL , 
        CHLDCLNTID INTEGER NOT NULL , 
        CONSTRAINT NXSDVPDTA.QSYS_FBORG00001_00001 PRIMARY KEY( ORGCLNTID , CHLDCLNTID ) ) ; 
    
      
    
    ALTER TABLE NXSDVPDTA.FBORGCLIENT 
        ADD CONSTRAINT NXSDVPDTA.FBORG_CLIENT 
        FOREIGN KEY( ORGCLNTID ) 
        REFERENCES NXSDVPDTA.FBCLIENT ( CLIENTID ) 
        ON DELETE CASCADE 
    
        ON UPDATE NO ACTION ;
    
    
    CREATE TABLE NXSDVPDTA.FBCLIENT ( 
        CLIENTID INTEGER GENERATED BY DEFAULT AS IDENTITY ( 
        START WITH 1 INCREMENT BY 1 
        MINVALUE 1 MAXVALUE 2147483647 
        CYCLE NO ORDER 
        CACHE 20 ) 
        , 
    
        CLNTTYPE CHAR(1) CCSID 37 DEFAULT NULL , 
        MEMBERNO VARCHAR(6) CCSID 37 DEFAULT NULL , 
        FNAME VARCHAR(50) CCSID 37 DEFAULT NULL , 
        MNAME VARCHAR(50) CCSID 37 DEFAULT NULL , 
        LNAME VARCHAR(50) CCSID 37 DEFAULT NULL , 
        CMPYNAME VARCHAR(75) CCSID 37 DEFAULT NULL , 
        PREFIX VARCHAR(10) CCSID 37 DEFAULT NULL , 
        SUFFIX VARCHAR(10) CCSID 37 DEFAULT NULL , 
        BIRTHDATE DATE DEFAULT NULL , 
        SEX CHAR(1) CCSID 37 DEFAULT NULL , 
        MARITAL CHAR(1) CCSID 37 DEFAULT NULL , 
        SSN VARCHAR(9) CCSID 37 DEFAULT NULL , 
        SEARCH VARCHAR(100) CCSID 37 DEFAULT NULL , 
        NOTES VARCHAR(100) CCSID 37 NOT NULL DEFAULT '' , 
        OCCUPATION VARCHAR(25) CCSID 37 NOT NULL DEFAULT '' , 
        CONSTRAINT NXSDVPDTA.FBCLIENT_PK PRIMARY KEY( CLIENTID ) ) ; 
    
    #255840 Reply

    Riyad Kalla
    Member

    What database and what JDBC driver are you using? Additionally please paste the result from MyEclipse > About MyEclipse > Configuration Summary.

    #255844 Reply

    idfbins
    Member

    I am using DB2 UDB running on an iSeries V5R2.
    JDBC Driver is: com.ibm.as400.access.AS400JDBCDriver

    *** Date: Mon Jul 31 09:41:13 MDT 2006

    *** System properties:
    OS=Windows2000
    OS version=5.0
    Java version=1.4.2_08

    *** MyEclipse details:
    MyEclipse Enterprise Workbench

    Version: 4.1.1 GA
    Build id: 20060309-4.1.1-GA

    *** Eclipse details:
    Eclipse SDK

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse Platform

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse RCP

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse Java Development Tools

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse Plug-in Development Environment

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse Project SDK

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\Eclipse3_1MyEclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    e0_3c
    -clean
    -vm
    C:\j2sdk1.4.2_08\bin\javaw.exe

    #255869 Reply

    Haris Peco
    Member

    idfbins ,

    Please, can you see primary and foreign keys in Db Explorer (click on table and look Table/Object view) ?

    If you can’t, then problem is jdbc driver, probably – try with newer driver
    We haven’t tested exactly your databases, but Db Explorer and ERD digram use ordinal jdbc call for grabing PK/Fk relations

    If you can, then your jdbc driver is correct and we will explore problem further

    Thanks

    #255870 Reply

    idfbins
    Member

    By “Table/Object” view, do you mean “Table Info”? If so, the primary keys and foreign keys tabs are empty. I am using a fairly current driver. In addition, other tables foreign key relationships appear in the generated ERD. If this were a JDBC driver issue I would suspect that there would not be any FK relationships. However, 90% of the FK relationships are being shown in the ERD and 10% are not there.

    #255871 Reply

    Haris Peco
    Member

    Yes,it’s Table info view – we rename it in 5.0 m2 to Table Info view

    Are you sure that this table have PK/FK ?

    … and please see Error log view

    Windows-Show View-Other – PDE runtime-Error log view

    Have you some in this view when you click in this table and look FK/PK on this table.

    Thanks

    #255952 Reply

    idfbins
    Member

    I looked at the error messages. They indicated that I did not have proper authority to the tables. Once I updated the authority, everything worked fine. Thanks for your help.

    #255956 Reply

    Riyad Kalla
    Member

    Glad it’s working now.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: [Closed] Generate ERD does not show FK relationship

You must be logged in to post in the forum log in