[Dbix-class] many updates at once

Len Jaffe lenjaffe at jaffesystems.com
Thu Aug 20 14:55:47 GMT 2015


On Thu, Aug 20, 2015 at 8:11 AM, Martin Spevak <martin.spevak at hp.com> wrote:

> Hi all,
>
> [edit] I need to update let say 200.000 rows. Each row should have
> different number of changed columns.
>
[edit] I don't care if update is success or not. Some kind of bulk update.
> My idea was to send all UPDATE queries as strings into storage procedure
> (let say per 10 queries). So I try to get this query from DBIx somehow as
> ResultSet->as_query (but this is not possible for update command).
>
> Do you have any other ideas, how to send few update commands in one packet?
>

I think you're on a good path.

Send a data structure to a stored proc.
execute stored proc using literal SQL "EXECUTE foo() ....."

Since you don't care about results, it's fire and forget.



-- 
Len Jaffe -  lenjaffe at jaffesystems.com
614-404-4214    @LenJaffe <https://www.twitter.com/lenJaffe>
www.lenjaffe.com
Host of Code Jam Columbus <http://www.meetup.com/techlifecolumbus/>  -
@CodeJamCMH <https://www.twitter.com/CodeJamCMH>
Curator of Advent Planet <http://www.lenjaffe.com/AdventPlanet/> - An
Aggregation of Online Advent Calendars.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20150820/280fd5e1/attachment.htm>


More information about the DBIx-Class mailing list