- This topic has 7 replies, 3 voices, and was last updated 18 years, 6 months ago by Riyad Kalla.
-
AuthorPosts
-
idfbinsMemberI 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 ) ) ;
Riyad KallaMemberWhat database and what JDBC driver are you using? Additionally please paste the result from MyEclipse > About MyEclipse > Configuration Summary.
idfbinsMemberI 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 WorkbenchVersion: 4.1.1 GA
Build id: 20060309-4.1.1-GA*** Eclipse details:
Eclipse SDKVersion: 3.1.2
Build id: M20060118-1600Eclipse Platform
Version: 3.1.2
Build id: M20060118-1600Eclipse RCP
Version: 3.1.2
Build id: M20060118-1600Eclipse Java Development Tools
Version: 3.1.2
Build id: M20060118-1600Eclipse Plug-in Development Environment
Version: 3.1.2
Build id: M20060118-1600Eclipse Project SDK
Version: 3.1.2
Build id: M20060118-1600Eclipse 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
Haris PecoMemberidfbins ,
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 relationsIf you can, then your jdbc driver is correct and we will explore problem further
Thanks
idfbinsMemberBy “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.
Haris PecoMemberYes,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
idfbinsMemberI 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.
Riyad KallaMemberGlad it’s working now.
-
AuthorPosts