Tech Rocks

Coldfusion
Java
JQuery

An online resource for latest web technologies like Coldfusion, JRun, Pro*C, JQuery, HTML5, PHP, W3C, Java, J2EE, C, C++, ORACLE, PL/SQL, MySql, Ajax, Coldbox, Fusebox, UNIX, JavaScript, NodeJS and much more...

Friday, November 21, 2008

Inserting Custom SQL into DataMgr

Check this site out !
http://www.bryantwebconsulting.com/blog/index.cfm/2008/1/9/Inserting-Custom-SQL-into-DataMgr

Inserting Custom SQL into DataMgr
We ran into a situation on a current project where we needed to return a column based on complicated logic. We needed to have a column that indicated if the value of an answer had changed since the user had originally answered the question. This logic was sufficiently complicated that even a custom relation field wouldn't do the job.
In situations where a layer of abstraction isn't able to handle the complexity required, it makes sense to break out of that layer of abstraction. That is why a ColdFusion programmer may sometimes (rarely) have to revert to Java. For DataMgr, this suggests writing SQL manually in situations like this.
In our case, however, we had already defined several relation fields that we needed to use and we didn't want to have to redefine them (or to ask DataMgr for the SQL for each relation field individually). We needed a way to add a field composed of complex SQL to our query without losing the benefit of our DataMgr relation fields.

0 comments :

Post a Comment