Multiple Deletes

0 views
Skip to first unread message

jeff

unread,
Jul 15, 2008, 4:00:35 PM7/15/08
to transfer-dev
Is it possible to execute a multi-row delete in transfer, something
like;

DELETE from PEOPLE.PEOPLE as PEOPLE where
PEOPLE.PEOPELID IN ( :peopleIDList)

And if I can do this, what do i call after i've created the query to
execute it:

<cfset qBulkDelete = transfer.listByQuery(query) />

Its probably not listbyquery, but is there a generic runSQL() function
or something?


Bob Silverberg

unread,
Jul 15, 2008, 4:16:39 PM7/15/08
to transf...@googlegroups.com
No, you cannot do that. You either have to delete each object
individually, using transfer.delete(myObject), or you can just run a
standard DELETE statement via cfquery.

If you do the latter, and Transfer is configured to cache the objects
which you are deleting, you'll need to manually discard them from the
cache after running your SQL statement. Transfer provides you with
four methods for manually discarding objects: discardByClassAndKey(),
discardByClassAndKeyArray(), and discardByClassAndKeyQuery(). One of
the two last ones would probably be appropriate for your use case.
See http://docs.transfer-orm.com/wiki/Managing_the_Cache.cfm for more
details.

Bob

--
Bob Silverberg
www.silverwareconsulting.com

Reply all
Reply to author
Forward
0 new messages