using sqlrecord_create for a lot of rows

This is the place to post technical queries about SQL Yoga

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, trevordevore

Post Reply
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 872
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

using sqlrecord_create for a lot of rows

Post by trevordevore » Fri Oct 11, 2013 2:16 pm

I am populating a table from an array.

The array holds one record for each table row.

I am using sqlrecord_create to do this and calling it each time I step through each array record.

reading the answer to the question on the speed of sqlrecord_create got me thinking I may be doing this inefficiently as I seem to be doing multiple writes to the database file, one for each record when I should do a single write where I commit all the records at once.

Is my thinking correct here?

If so, how do I batch all these record creations for a single write episode?

James
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 872
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: using sqlrecord_create for a lot of rows

Post by trevordevore » Fri Oct 11, 2013 2:16 pm

just did a search on the Livecode user list and found your answer to another user.

basically fill an indexed array from the repeated calls to "sqlrecord_set" and use this array as the argument for "sqlrecord_create"

so answered :-)
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

Post Reply

Return to “SQL Yoga”