1

I use specific custom SQL functions for chemistry purpose, like a chemistry cartridge for MySQL (mychem).
My users give me a first field (text 'molfile') through a regular form, in a text area and I compute other fields (blob 'obserialized') on the fly when inserting.

My SQL statement looks like :

INSERT INTO `bin_structures` (`id`,`obserialized`)
  VALUES (`mol_id`,  MOLECULE_TO_SERIALIZEDOBMOL(`molfile`));

short for the exemple.
Is there a way (beforeSave callback?) to add 'obserialized' field and MOLECULE_TO_SERIALIZEDOBMOL(molfile) value to the SQL statement or am I on the wrong way with a callback?

Darwin von Corax
  • 5,201
  • 3
  • 17
  • 28
Thiull
  • 11
  • 1
  • Possible duplicate of [How to genereate SQL function calls with the CakePHP query builder?](http://stackoverflow.com/questions/30845997/how-to-genereate-sql-function-calls-with-the-cakephp-query-builder) – ndm Apr 08 '16 at 16:22

0 Answers0