using sqlrecord_create for a lot of rows

This is the place to post technical queries about SQL Yoga

Moderators: FourthWorld, heatherlaine, Klaus, robinmiller, trevordevore

Post Reply
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
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 - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
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 - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Post Reply

Return to “SQL Yoga”