Advanced Querying with Instant jchem

User 010ddfdc89

02-11-2009 02:54:37

Hi Folks,


Is there any way to run a sql query against the Derby database within jchem.


Also, is it possible to add and populate a derived column in jchem? For example, I have 10 chemical terms columns populated with a 1 or 0. I want to add a column that sums the values in these columns and populates the summed value?


Cheers.


Peter

ChemAxon fa971619eb

02-11-2009 08:29:18

Is there any way to run a sql query against the Derby database within jchem.


This isn't currently posible. You can of course run a SQL query outside IJC, but you can't run one inside it and see the results in IJC.


Technically it would be posible to allow this, but it would be very complex to combine this with structure searches.


Also, is it possible to add and populate a
derived column in jchem? For example, I have 10 chemical terms columns
populated with a 1 or 0. I want to add a column that sums the values in
these columns and populates the summed value?



The chemical terms language does allow mathamatical operators. e.g.


donorCount() + acceptorCount()


but if any function is present in multiple columns it will be recalculated for each, which is not very efficient. IJC does not yet provide a direct way to perform these calculations except for chemical terms calculation. However you could easily do this directly in the database by adding a trigger that calculates the values. The simplest approach is to create a field in IJC for the results, and then add a trigger using SQL to calculate them.


We will be providing a way to do this directly in IJC in the future.


Tim