Join Two Tables

User ce5f27518b

21-06-2011 13:20:36

Hi everybody,


I want to join to tables on a common field (MY_ID in my case).


The first file imported is a SD file containing structures and datablocks. The second one is a tab file containing other information on molecules (number of pharmacophores points for example).


The two tables contain the same number of lines.


I try to create entity and relationship but it was not successful.


What is the easiest way to do it?


Thanks a lot,


Emilie

ChemAxon fa971619eb

21-06-2011 20:40:14

Firstly, if you are importing 2 files with a common key between the rows you might want to look at importing the pharmacophore data into the structure table, by first importing the SD file and then merging the pharmacophore data (CSV file?) into the structure table using the merge function of import.
See http://www.chemaxon.com/instantjchem/ijc_latest/docs/user/help/htmlfiles/moving_data/merging_data.html


Having the data in the same table is usually much simpler and better than using multiple tables and the relational data handling capabilites of IJC. Of courese, this is only possible if there is a one-to-one relationship between the two sets of data.


If you must use relationships between the tables then you need to create a one-to-one relationship between the two tables. Do this using the schema editor:
http://www.chemaxon.com/instantjchem/ijc_latest/docs/user/help/htmlfiles/editing_database/schema_editor.html


Adding a relationship is described here:
http://www.chemaxon.com/instantjchem/ijc_latest/docs/user/help/htmlfiles/editing_database/editing_relationships.html />You need a 'Simple relationship' of type one-to-one.


Once the relationship is created you need to modify the data tree to add a child to the parent using the relationship you just created. See here:
http://www.chemaxon.com/instantjchem/ijc_latest/docs/user/help/htmlfiles/editing_database/editing_datatrees.html


Finally, you need to create a form that has widgets from both the parent and the child.


The whole proces scan be see here:
http://www.chemaxon.com/instant-jchem-animations/working-with-data/relational-form-building/


Hope this helps.


Tim

User ce5f27518b

22-06-2011 07:18:30

Perfect, it works with the merge function!!! and it is really simple.


Thanks,


Emilie