Python, Mysql, insert NULL

2008-04-04 Thread Pallavi Kale
Hello there, I was going through the thread of conversation happening around inserting null using python into mysql. I am facing a similar problem here. I have to insert say 8 values into a table using a stored procedure. Of the 8 values 2 are not null and the remaining can be null, most

Re: Python, Mysql, insert NULL

2006-05-18 Thread Yaron Butterfield
I figured this out. Because I am using InnoDB, I need to add the commit statement. Phew. Yaron Butterfield wrote: > Hi, > > I've been having problems using Python to insert data into a MySQL > database. I've donw web searches and pulled my hairs out getting it > to work but cannot. I have

Python, Mysql, insert NULL

2006-05-18 Thread Yaron Butterfield
Hi, I've been having problems using Python to insert data into a MySQL database. I've donw web searches and pulled my hairs out getting it to work but cannot. I have no trouble doing select queries, but when I use Python to insert, though I do not receive any errors from python, the table doe

Re: Python, Mysql, insert NULL

2005-10-06 Thread Thomas Bartkus
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > If you don't understand parameterized SQL queries you would do well to > refrain from offering database advice :-) Did the poster ask a question about parameterized queries or server security? > Presumably you always

Re: Python, Mysql, insert NULL

2005-10-06 Thread Python_it
Thanks for the many replies! The problem was that is use '%s', i have to use %s and then my problem is solved. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, Mysql, insert NULL

2005-10-06 Thread Steve Holden
Thomas Bartkus wrote: [...] > > Others here have pointed out that the Python keyword "None" is converted to > "Null" when passed to MySQL. I don't quite understand this and don't really > care. If I have a Python variable that has a value None, and I want to > transmit this to MySQL as Null - I w

Re: Python, Mysql, insert NULL

2005-10-05 Thread Thomas Bartkus
"Python_it" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I know how to insert values in a database. > That's not my problem! > My problem is how i insert NULL values in de mysql-database. > None is een object in Python and NULL not. > None is not converted to NULL? > Table shows No

Re: Python, Mysql, insert NULL

2005-10-05 Thread deelan
Python_it wrote: > I know how to insert values in a database. > That's not my problem! > My problem is how i insert NULL values in de mysql-database. > None is een object in Python and NULL not. > None is not converted to NULL? > Table shows None and not NULL! None is converted to mysql's NULL and

Re: Python, Mysql, insert NULL

2005-10-05 Thread Steve Holden
Python_it wrote: > I know how to insert values in a database. > That's not my problem! > My problem is how i insert NULL values in de mysql-database. So you *don't* know how to insert values in a database: as Laszlo wrote, you might be best using parameterized queries. > None is een object in Py

Re: Python, Mysql, insert NULL

2005-10-05 Thread Gerhard Häring
Python_it wrote: > I know how to insert values in a database. > That's not my problem! > My problem is how i insert NULL values in de mysql-database. > None is een object in Python and NULL not. > None is not converted to NULL? > Table shows None and not NULL! As Laszlo wrote, "None will be conver

Re: Python, Mysql, insert NULL

2005-10-05 Thread Python_it
I know how to insert values in a database. That's not my problem! My problem is how i insert NULL values in de mysql-database. None is een object in Python and NULL not. None is not converted to NULL? Table shows None and not NULL! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, Mysql, insert NULL

2005-10-05 Thread Laszlo Zsolt Nagy
> > BTW, you did not write which driver are you using. Oh, you did. Sorry. :-( Import your DB module 'yourmodule' and then print yourmodule.paramstyle Description of paramstyle is also in PEP249: paramstyle String constant stating the type of parameter marker

Python, Mysql, insert NULL

2005-10-05 Thread Python_it
Python 2.4 MySQL-python.exe-1.2.0.win32-py2.4.zip How can I insert a NULL value in a table (MySQL-database). I can't set a var to NULL? Or is there a other possibility? My var must be variable string or NULL. Becaus i have a if statement: if cursor.execute(".insert NULL

Re: Python, Mysql, insert NULL

2005-10-05 Thread Laszlo Zsolt Nagy
Python_it wrote: >Python 2.4 >MySQL-python.exe-1.2.0.win32-py2.4.zip > >How can I insert a NULL value in a table (MySQL-database). >I can't set a var to NULL? Or is there a other possibility? >My var must be variable string or NULL. >Becaus i have a if statement: >if > cursor.execute("..