Personally I would keep all the functionality in a cfc. Perhaps breaking it
into two separate functions in the same CFC.

The first function accepts an input of type recordset or structure, loops
through, passing each record to the second function which only performs the
Inserts returning success or failure by wrapping the insert in a try and
catch. The first function would then append the results to a errorlog
structure or record set and return that to the calling page. Thus you would
have a function that accepts the recordset/structure to insert and returns a
recordset/structure of any conditions that arose during the process.

I hope this doesn't sound too convoluted.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of barry.b
Sent: Friday, 14 May 2004 1:09 AM
To: CFAussie Mailing List
Subject: [cfaussie] RE: best way to do multiple inserts (using CFC's)

thanx for your interest Theo.

sadly, I can't use SP's, triggers, views or XML dumps with this DB
(informix - oh how I wish it was SQLserver!)

but it's not really a db question, more where to do error handling. In
this case, if an insert goes wrong, swallow the error (flag it for
display) and carry on processing the other inserts.

so where would people do this? in the calling page (loop and call insert
method), collecting errors as you do them one by one
- or -
in the CFC (unpack, loop and insert), throwing back a list of dud inserts,
if they occur?

thanx
barry.b

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

This message may contain privileged or confidential information and is
intended only for the individual named. If you are not the named addressee
you should not disclose, disseminate, distribute or copy this e-mail. If you
have received this e-mail by mistake please notify the sender immediately by
e-mail and delete this e-mail from your system. You should rely on your own
virus checking programmes and procedures for checking any attachments.
Please advise us if you wish your name and e-mail address to be removed from
our database.


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to