Reverse a list
Dr. Hawkins
dochawk at gmail.com
Tue Feb 17 16:21:57 EST 2015
On Tue, Feb 17, 2015 at 12:11 PM, Mike Kerner <MikeKerner at roadrunner.com>
wrote:
> The following is very fast:
> put "INSERT INTO sortTest VALUES :1" into tSQL
> repeat for each line tLine in tDataSet
> revExecuteSQL dbid, tsql, tline
> end repeat
>
Faster still would probably be to build a command in the loop. Terminate
each line with ";" & cr
Then put "BEGIN TRANSACTION;" & cr before it, and "END TRANSACTION;" &
cr after it, and execute as a single command.
However, I haven't used the :1 type syntax, and just don't know if it can
handle that.
put "BEGIN TRANSACTION;" & cr into dcmd
repeat for each line tline in tDataSet
put "INSERT INTO sortTest <something>" & ";"& cr after dcmd
put "END TRANSACTION;" & cr after dcmd
revExecuteSQL dbid, tcmd
--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
More information about the use-livecode
mailing list