Carsten Haese wrote:
> On Fri, 2007-10-12 at 13:12 +0200, Florian Lindner wrote:
>> Carsten Haese wrote:
>> > sql = "INSERT INTO "+DOMAIN_TABLE+"("+DOMAIN_FIELD+") VALUES (%s)"
>> > executeSQL(sql, domainname)
>>
>> Ok, I understand it and now it works, but why is limitation? Why can't I
>> just
On Fri, 2007-10-12 at 13:12 +0200, Florian Lindner wrote:
> Carsten Haese wrote:
> > sql = "INSERT INTO "+DOMAIN_TABLE+"("+DOMAIN_FIELD+") VALUES (%s)"
> > executeSQL(sql, domainname)
>
> Ok, I understand it and now it works, but why is limitation? Why can't I
> just the string interpolation in a
Florian Lindner wrote:
> Carsten Haese wrote:
>
>> On Thu, 2007-10-11 at 15:14 +0200, Florian Lindner wrote:
>>> Hello,
>>> I have a function that executes a SQL statement with MySQLdb:
>>>
>>> def executeSQL(sql, *args):
>>> print sql % args
>>> cursor = conn.cursor()
>>> cursor.ex
Carsten Haese wrote:
> On Thu, 2007-10-11 at 15:14 +0200, Florian Lindner wrote:
>> Hello,
>> I have a function that executes a SQL statement with MySQLdb:
>>
>> def executeSQL(sql, *args):
>> print sql % args
>> cursor = conn.cursor()
>> cursor.execute(sql, args)
>> cursor.close
On Thu, 2007-10-11 at 15:14 +0200, Florian Lindner wrote:
> Hello,
> I have a function that executes a SQL statement with MySQLdb:
>
> def executeSQL(sql, *args):
> print sql % args
> cursor = conn.cursor()
> cursor.execute(sql, args)
> cursor.close()
>
> it's called like that:
>
I don't think you can substitute the table name and column names in the
execute, just values ( I could be wrong)
try building it like this:
sql = "INSERT INTO %s %s VALUES " % (taablename, columnstuple, '(%s)')
cursor.execute(sql, values)
> Hello,
> I have a function that executes a SQL statemen
On Thu, Oct 11, 2007 at 03:14:30PM +0200, Florian Lindner wrote regarding
Problem with MySQL cursor:
>
> Traceback (most recent call last):
> File "manage.py", line 90, in ?
> addDomain(domainName)
> File "manage.py", line 27, in addDomain
> executeSQL(sql, DOMAIN_TABLE, DOMAIN_FIELD