Importing Data with Relationships

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Ewanm
Posts: 111
Joined: Mon Jun 04, 2007 11:09 am
Location: Scotland

Importing Data with Relationships

Post by Ewanm »

I have exported my data from my production database and have created four files.

Clients.csv
Client_Contacts.csv
Client_Ref.csv (Automatically Generated by Export Command)
Client_Contact_refs.csv . (Automatically Generated by Export Command)

I am trying to import this data into a test server.

I run the import command and the Clients are imported and the Client_Contacts are imported.

Client_Contacts are a child of Clients and there can be multiple Client Contacts but the relationship does not seem to be created. I have also tried importing the ref files with no success.

Can anyone point me in the correct direction?

Thanks
PointsWell
Posts: 1473
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Importing Data with Relationships

Post by PointsWell »

Ewanm wrote:I have exported my data from my production database and have created four files.

Clients.csv
Client_Contacts.csv
Client_Ref.csv (Automatically Generated by Export Command)
Client_Contact_refs.csv . (Automatically Generated by Export Command)

I am trying to import this data into a test server.

I run the import command and the Clients are imported and the Client_Contacts are imported.

Client_Contacts are a child of Clients and there can be multiple Client Contacts but the relationship does not seem to be created. I have also tried importing the ref files with no success.

Can anyone point me in the correct direction?

Thanks
If you don’t have any pm fields in your table you can just use sql to export the data rather than AIM

Eg
ClientContact.obClients.clientNo, ClientContact.Attribute etc etc

Then you don’t need the ref files.
Ewanm
Posts: 111
Joined: Mon Jun 04, 2007 11:09 am
Location: Scotland

Re: Importing Data with Relationships

Post by Ewanm »

Thanks, I need to make the export/import feature available for some of my users later so I need to understand how to do this from within AIM.

You use the term 'pm', can you explain what this means?

Thanks
PointsWell
Posts: 1473
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Importing Data with Relationships

Post by PointsWell »

Peer multiple.

Eg
BOs
Person
Languages

A person can speak many languages
Person.pmLanguages

If you just use languages as a list within the person BO then AIM will generate a hidden table Person_ref to manage that many to many relationship.

Generally I try to avoid simple list attributes in a BO as I tend to need extra data like Date Added, Active, Added By

This reduces the number of _REF tables and consequently simplifies export tables.

I ended up avoiding the built in Export function as it made the export files to complicated for my 2D brain
Post Reply