On Friday 09 July 2010 07:18:30 Sells, Fred wrote:
> In MySQLdb you do something similar to
>
> Records = [ (1,2,3), (4,5,6), (7,8,9) , (11,22,33) ]
>
> cursor.execute('insert to mytable (a,b,c) VALUES (%s, %s, %s)', Records)
> #untested.
>
> This would insrt 4 rows
>
it is two statements ;-)
:django-us...@googlegroups.com] On Behalf Of Kenneth Gonsalves
Sent: Thursday, July 08, 2010 8:46 PM
To: django-users@googlegroups.com
Subject: Re: How can I Insert multiple records in one statement
On Friday 09 July 2010 06:03:09 Sells, Fred wrote:
> I know how to do this in raw MySQLdb and have been try
On Friday 09 July 2010 06:03:09 Sells, Fred wrote:
> I know how to do this in raw MySQLdb and have been trying to find a way
> to do it with the Django models but with no success.
>
how do you do it in MySQLdb? What exactly do you mean by 'insert multiple
records in one statement'?
--
Regards
K
I know how to do this in raw MySQLdb and have been trying to find a way
to do it with the Django models but with no success.
Can it be done and if so, can someone point me to a link in the docs
please?
Everything looks so elegant with the models, I hate to drop into SQL if
I don't have to.
--
Y
4 matches
Mail list logo