On Fri, 16 Sep 2011 12:27:35 -0700, Jim Michaels
<[email protected]> wrote:
>INSERT is supposed to handle multiple rows for VALUES.
>for example,
>INSERT INTO table(digit,dialpadstr) VALUES
>(2,'abc'),
>(3,'def'),
>(4,'ghi'),
>(5,'jkl'),
>(6,'mno'),
>(7,'pqrs'),
>(8,'tuv'),
>(9,'wxyz');
With the preferred
{
_open*()
:
_exec('BEGIN')
_prepare*()
while rows2insert{
_bind*()
_bind*()
:
:
_step()
_reset() (?)
}
_finalize()
_exec('COMMIT')
:
_close()
}
sequence, there is no need for a multirow INSERT syntax.
It would complicate the _bind()
With shell scipts, it doesn't have much advantage either, as you
can prepend the fixed part
"INSERT INTO tablename (colname1,...colnameN) VALUES "
very easily, e.g.
somepreprocess | awk -f script | sqlite3 database >log
where script contains something like:
{
printf \
"INSERT INTO ... VALUES (%d,'%s',...);\n",\
$1,$2,...
}
>currently, sqlite only handles 1 row.
>INSERT INTO table(digit,dialpadstr) VALUES
>(2,'abc');
--
( Kees Nuyt
)
c[_]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users