Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Matt Walters on September 03, 2008, 07:22:50 pm

Title: Import Database Schema - Foreign Key associations.
Post by: Matt Walters on September 03, 2008, 07:22:50 pm
I am using the import database schema tool to import an ODBC database schema.

Does anyone know if the import feature can import foreign key relationships from the databse?
Title: Re: Import Database Schema - Foreign Key associati
Post by: «Midnight» on September 03, 2008, 09:32:07 pm
Yes it can.

At least for some DBMS engines. Note that both ends of the relationship must be within the scope of the import. [Which should be the norm, but apparently some configurations just don't seem to guarantee that, and unsatisfactory results can occur.]
Title: Re: Import Database Schema - Foreign Key associati
Post by: Matt Walters on September 03, 2008, 09:42:15 pm
Thanks for you reply!

I am importing the objects at both ends of the relationship.

The database I am importing from is Adaptive Server Anywhere version 9.0.  So maybe relationships are not imported for this database?

Unless there are any settings in the Import DB Schema dialogue box that need setting in order to import relationships?

Title: Re: Import Database Schema - Foreign Key associati
Post by: «Midnight» on September 03, 2008, 09:52:43 pm
I would expect ASA to import correctly. By all means play around with the settings and see if there is a change.

Try using an OLEDB driver when you run through the connection dialog boxes (to set up a DSN on your machine). Also, make sure you've got a current ASA-specific OLEDB client version.

Please let us know what occurs.

David
Title: Re: Import Database Schema - Foreign Key associati
Post by: «Midnight» on September 03, 2008, 09:56:45 pm
Make sure you are importing as new classes, or that you synchronize constraints. Foreign keys are often expressed as constraints by DBMS engines. [I'm guessing here, but it might make a difference.]
Title: Re: Import Database Schema - Foreign Key associati
Post by: LAJO on September 04, 2008, 09:59:46 pm
I have the same problem with an Oracle DB.
I am able to import the schema via ODBC but the relationships are not displayed. My tables are loosing their FKs. :-/
May i am choosing a wrong setting for the import..?
cheers
Title: Re: Import Database Schema - Foreign Key associati
Post by: hd on September 05, 2008, 07:42:39 am
Make sure you are using Oracle's ODBC driver, not "Microsoft ODBC for Oracle".

If that does not fix it, report the issue to Sparx Support.
Title: Re: Import Database Schema - Foreign Key associati
Post by: «Midnight» on September 05, 2008, 08:35:28 am
Please post the version of the Oracle driver you use (or are already using) as well as whether that version worked or not.

Thanks much,
David