At 08:49 AM 7/8/2004, you wrote:
1. How do you handle retrieving data from multiple tables that are joined in the SQL.
For select joins, most can be done as views. Do not use <cfquery> to do ad hoc joins whenever a view can be defined for the join. Use <cfquery> to select from the view.
2. Do you use SQL SELECT/INSERT/UPDATE/DELETE statements or stored procs?
Use stored procedures whenever table data changes, i.e., inserts, updates and deletes. These are very simple procedures and can be created quickly. Using stored procedures for changes instead of dynamic queries, like with cfinsert, allows the db to complete the transaction within the database's scope rather than within CF's scope.
4. Can someone post an example CFC that performs these SQL actions?
Download my CFSQLTool that works with CFMX and SQL Server, it will happily generate the CFC for table CRUD, stored procedures and CFC using stored procedures.
http://www.switch-box.org/CFSQLTool/Download/
Thanks
"Adam Cameron" wrote >> Each DB table has a CFC that relates to it, and might have methods >> like get(), add(), update(), delete(). The get() function will take >> an argument for each field of the table, to allow filtering >> (basically chucking it in a where statement), as well as an >> additional 'whereClause' argument for stuff that ain't a direct col=value filter.
---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
----------------------------------------------------------------------- http://www.switch-box.org/CFSQLTool/Download/
Switch_box MediaFirm, Inc. www.Switch-box.org Loveland, CO USA
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
