>>- CFQUERY to see if the record existed in the database
   - CFIF the record exists
      - CFQUERY, doing an UPDATE
   - CFELSE
      - CFQUERY, doing an insert

Personnaly I use another approach:
Every record is edited by calling anythingEdit.cfm?id=recordId
If the user is creating a new record, he will use the same template with 
id=0.
The edit template always starts with a query to get the record to edit 
in order to fill the form.
In case of a new record, the query WHERE id=0 returns an empty record, 
and all fields in the form
are empty.
Now, in the anythingUpdate.cfm, the logic is simply:
   - CFIF id EQ 0
      - CFQUERY, doing an INSERT
   - CFELSE
      - CFQUERY, doing an UPDATE

Now, concerning stored procedures, I would say that one of the big 
advantage is when you need to do things
that would be difficult, or impossible to do in SQL.
Otherwise, the gain is not really very much more than having the query 
precompiled in the database.
For large queries at least, the impact is marginal.

-- 
_______________________________________
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228369
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to