[FX.php List] Updating many Records - Best Practice?
John Funk
csinfo at criticalsolution.com
Wed Feb 15 08:53:03 MST 2012
Not to chime in late on this discussion but... when I have to update many
records I find the records with PHP/FX and then execute an FM script. This
is like having the FMServer run a server side script and is very fast.
John
On 2/2/12 1:10 PM, "Glyn Devine" <glyn.devine at quickseries.com> wrote:
> FX List,
>>
> Many thanks for your responses!
>
> The first one I tried was simply editing each record as the user paged
> through. This is too slow. This single query:
>
> $q = new FX( $this->serverIP, $this->webCompanionPort, $this->dataSourceType
> );
> $q->SetDBUserPass( $this->user, $this->pword );
> $q->SetDBData( 'Master', 'InventoryCount_Edit');
> $q->AddDBParam('-recid', $uid);
> $q->AddDBParam('NbrBox', $boxes);
> $q->AddDBParam('NbrPack', $packs);
> $q->AddDBParam('NbrUnits', $units);
> $q->FMEdit();
>
> Takes about 7-8 seconds! It takes less time to read 1300 records out of
> FileMaker... Why? Is there anything I can do to optimize it? The layout has
> only the 4 necessary fields on it...
>
> If I commit all the record edits at the end, I don¹t mind if it takes 30
> seconds, I can throw up a ³Please Wait...² screen or something, but could
> someone show me a code sample of how to do this edit records in a portal
> thing?
>
> I assume I¹d connect, go to the right layout, run a loop calling
> ³SetPortalRow² for every edited record, and finish that up with an FMEdit() -
> is that right? Now, just to throw a little wrench into the works, my
> relationship is controlled by setting global fields. To get the right set of
> records into the portal, I have to set 2 global fields (Month and Year) first.
> How would I go about that?
>
> Thanks for all the help so far!
> Glyn
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20120215/bf3f1368/attachment.html
More information about the FX.php_List
mailing list