Is it possible to make exact mass as a calculated field?

User b9aa8da57b

16-08-2016 01:27:14

Hi 


In my grid view i have a molecule field "structure" where we put cartridge index on this field. I know in JChem API you can calculate exact mass as molecule.getExactMass(). But when i put return structure.getExactMass() as calculated field it indicates as invalid.


Is it possible to get exact mass as calculated filed.


Thanks


Dong 

ChemAxon 206bfdcce5

19-08-2016 09:39:38

Dear Dong,


the most easy way how to add the exact mass to your grid view is to add a chemical terms column with exactMass() expression. You can just start to type exa and let the right-click assist you. Basically, in this way you can use all the chemical terms functions (as long as you have a valid license for the calculator). 


I hope this helps.


Best regards,


Karla

User b9aa8da57b

23-08-2016 18:32:41

Hi Karla, thanks for the tip. I did that but got following error. Set aside the error it seems that it tries to execute this statement to alter the cart index. If it is so i suppose we can directly run this in Oracle, instead of going through the IJC.


ALTER INDEX DARE.AA_DICTIONARY PARAMETERS('addAutoCalcCtWcn=EXACTMASS;FLOAT(32);exactmass')


Please advise 


Thanks


Dong


 


org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [ALTER INDEX DARE.AA_DICTIONARY PARAMETERS('addAutoCalcCtWcn=EXACTMASS;FLOAT(32);exactmass')]; SQL state [72000]; error code [1418]; ORA-01418: specified index does not exist


; nested exception is java.sql.SQLException: ORA-01418: specified index does not exist


 


at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)


at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)


at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)


at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:407)


at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:428)


at com.im.ijcs.impl.ddl.JChemTableManagerImpl$CartTableVersionHandler.fixChemTermsDefinitionForJChemIndex(JChemTableManagerImpl.java:2422)


at com.im.ijcs.impl.ddl.JChemTableManagerImpl$CartVersionLatest.addChemicalTermsColumnDefinitionForJChemIndex(JChemTableManagerImpl.java:2449)


at com.im.ijcs.impl.ddl.JChemCartridgeStandardTableModification.addChemicalTermsColumn(JChemCartridgeStandardTableModification.java:74)


at com.im.ijcs.impl.ddl.JChemTableManagerImpl$5.phase1InRequestProcessor(JChemTableManagerImpl.java:1715)


at com.im.commons.progress.BackgroundRunner.processTheTask(BackgroundRunner.java:144)


at com.im.commons.progress.BackgroundRunner$1.run(BackgroundRunner.java:106)


at com.im.commons.base.ThreadContext$2.run(ThreadContext.java:194)


at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1411)


at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1991)


Caused by: java.sql.SQLException: ORA-01418: specified index does not exist


 


at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)


at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)


at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)


at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)


at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)


at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)


at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)


at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1033)


at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)


at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1909)


at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1871)


at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:318)


at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)


at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)


at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)


at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:421)


at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:396)


... 10 more

ChemAxon 26d92e5dcd

24-08-2016 06:58:34

Dear Dong,


first of all, you should not try to add a calculated field with an SQL statement directly. Calculated fields are managed by JChem libraries and doing so, you pass over this management and with 99% probability you will cause problems. 


As for the SQL statement and the error. The error is coming from executing the SQL statement, or when you tried to add the calculated field via IJC Schema Editor? 


The SQL also looks wrong. If you are using cart index, then the default naming convention should be IDX_TABLE_NAME, so maybe it is looking for wrong index? 


This is more of a problem that would be better suited for JChem Cartridge support. Could you please also ask them for advice? 


Wishing all the best


David