Book a Demo

Author Topic: Import Database Schema - Foreign Key associations.  (Read 4131 times)

Matt Walters

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Import Database Schema - Foreign Key associations.
« 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?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Import Database Schema - Foreign Key associati
« Reply #1 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.]
No, you can't have it!

Matt Walters

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Import Database Schema - Foreign Key associati
« Reply #2 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?


«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Import Database Schema - Foreign Key associati
« Reply #3 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
No, you can't have it!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Import Database Schema - Foreign Key associati
« Reply #4 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.]
No, you can't have it!

LAJO

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Import Database Schema - Foreign Key associati
« Reply #5 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

hd

  • EA Administrator
  • EA User
  • *****
  • Posts: 312
  • Karma: +0/-0
    • View Profile
Re: Import Database Schema - Foreign Key associati
« Reply #6 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.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Import Database Schema - Foreign Key associati
« Reply #7 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
No, you can't have it!