Parameterize Queries?

User 77bcbbb206

08-02-2006 17:34:48

I was wondering if it were possible to parameterize a jc_compare query?





I know this is possible:


Code:
select CD_ID from RMS_STRUCTURE where jc_compare(CD_SMILES, 'c1ccccc1', ''t:t simThreshold:.999')=1;






But was wondering if this is possible as well?


Code:
select CD_ID from RMS_STRUCTURE where jc_compare(CD_SMILES, :v_smiles, ''t:t simThreshold::v_sim'')=1;






I have a feeling my syntax is incorrect, but ....?

ChemAxon aa7c50abf8

08-02-2006 18:09:12

Yes this syntax is incorrect. The option simThreshold accepts only literal values. References will not work.





We are working on an extension of our Chemical Terms engine where you will be able to refer to database fields within the chemical terms expression itself. However, even this future feature may not be (initially) as flexible as you might want it to be. No release date has yet been set for this feature.

ChemAxon aa7c50abf8

08-02-2006 19:35:02

Of course, if you would like to have a query as simple as shown in your example, you could use the jc_tanimoto operator with a variable:





Code:
select CD_ID from RMS_STRUCTURE where jc_tanimoto(CD_SMILES, :v_smiles') > :v_sim;

User 77bcbbb206

08-02-2006 19:45:46

Peter,





Thanks much for the knowledge and advice. I appreciate it. I am now using the tanimoto expression for parameterization.





-Jim

ChemAxon aa7c50abf8

09-02-2006 12:16:48

Jim,





And what about concatenation (not sure if it useful for you):


Code:
select CD_ID from RMS_STRUCTURE where jc_compare(CD_SMILES, :v_smiles, 't:t simThreshold:' || to_char(:v_sim))=1;


?


Peter