Re: [DB-SIG] mysql module embeds params in command string

2013-07-19 Thread Michael Bayer
On Jul 19, 2013, at 12:06 AM, Carl Karsten wrote: > That 1/2 answers my question - and it sounds correct for what you are saying. > > But I am wondering why they picked that one.Yeah Yeah "Ask them" > is the obvious answer :) oh, well MySQLdb has been around way longer than all the others.

Re: [DB-SIG] mysql module embeds params in command string

2013-07-18 Thread Carl Karsten
That 1/2 answers my question - and it sounds correct for what you are saying. But I am wondering why they picked that one.Yeah Yeah "Ask them" is the obvious answer :) I am also wondering why so many exist. I would think after a year or 2 they would all merge together. I have trouble trying

Re: [DB-SIG] mysql module embeds params in command string

2013-07-18 Thread Michael Bayer
If I had to guess why Django has a statement like that up, they may not have worked out their driver architecture such that they can easily swap out various DBAPI implementations on top of the same database backend; i.e. they probably have a "mysql.py" module with a big "import MySQLdb" hardcod

Re: [DB-SIG] mysql module embeds params in command string

2013-07-18 Thread Carl Karsten
Huh, I didn't know there were any other options. I wonder why this says this: MySQLdb is the Python interface to MySQL. Version 1.2.1p2 or later is required for full MySQL support in Django. https://docs.djangoproject.com/en/1.5/ref/databases/#mysqldb On Thu, Jul 18, 2013 at 9:08 AM, Michael

Re: [DB-SIG] mysql module embeds params in command string

2013-07-18 Thread Michael Bayer
On Jul 18, 2013, at 9:38 AM, Carl Karsten wrote: > I feel I need to post this now and then in hopes I find someone who > can do something about it. This might even be worth some PSF funding? > > I am not a security expert, I am not qualified to asses the risk, it > doesn't matter if I consider

Re: [DB-SIG] mysql module embeds params in command string

2013-07-18 Thread M.-A. Lemburg
Carl Karsten wrote: > I feel I need to post this now and then in hopes I find someone who > can do something about it. This might even be worth some PSF funding? > > I am not a security expert, I am not qualified to asses the risk, it > doesn't matter if I consider this a vulnerability. That sai

Re: [DB-SIG] MySQL

2008-06-09 Thread Andy Todd
Tariq Momani wrote: Hello How I can access MySQL by python in windows XP Best regards Tariq Momani Redirecting to the db-sig mailing list, where the collected wisdom of the community can help you out. Regards, Andy -- From the desk of Andrew J Todd esq - http://www.halfcooked.com

Re: [DB-SIG] Mysql query

2006-08-04 Thread Andy Todd
Patricia G. wrote: > Hi Andy, > > > Having a generic table with key value pairs like your current info > table > just leads to some really horrible SQL as you are currently finding. > > > > I agree with you . > > Unless you truly don't know what key-value pairs you are going t

Re: [DB-SIG] Mysql query

2006-08-03 Thread Andy Todd
Patricia wrote: > Hi all, > > I'm having a hard time trying to create this query. > I have two tables: > log - columns: id, name and date > info - columns: id, tag, value > > i.e.: > log > id | name | date > - > 1 | machine_name | 07/

Re: [DB-SIG] mysql string length?

2006-04-19 Thread Lukasz Szybalski
On 4/19/06, Andy Todd <[EMAIL PROTECTED]> wrote: > Lukasz Szybalski wrote: > > On 4/18/06, Lukasz Szybalski <[EMAIL PROTECTED]> wrote: > >> On 4/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >>> On Mon, 17 Apr 2006, Andy Todd wrote: > >>> > > stmt = "INSERT INTO table_x (body) VALUE

Re: [DB-SIG] mysql string length?

2006-04-19 Thread Carsten Haese
On Wed, 2006-04-19 at 03:45, Andy Todd wrote: > Now hands up for changing the DB-API to remove the pyformat paramstyle? > If we're going to have options I think we should restrict them to either > named parameters (a la cx_Oracle) or the '?' qmark (a la ODBC and JDBC). I'm all for that with the

Re: [DB-SIG] mysql string length?

2006-04-19 Thread Andy Todd
Lukasz Szybalski wrote: > On 4/18/06, Lukasz Szybalski <[EMAIL PROTECTED]> wrote: >> On 4/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >>> On Mon, 17 Apr 2006, Andy Todd wrote: >>> > stmt = "INSERT INTO table_x (body) VALUES (%s)" # [1] > cursor.execute(stmt, (body,)) >>

Re: [DB-SIG] mysql string length?

2006-04-18 Thread Python
On Tue, 2006-04-18 at 13:00 -0500, Lukasz Szybalski wrote: > > When i try : > > c.execute("Insert into table_x(body) VALUES(%s)",(body)) > > This will work but how do i make : > > > > sql="Insert into table_x(body) VALUES(%s)",(body) > > c.execute(sql) #complains that i give it a tuple, which i di

Re: [DB-SIG] mysql string length?

2006-04-18 Thread engelbert . gruber
On Tue, 18 Apr 2006, Lukasz Szybalski wrote: SNIP > Ok guys, thanks for help. I finally search for how to scape strings and i > used: > > "insert into table(id,body) values ('%d',"'''"%s"'''")"%(id,body) > > where "'''" on each side of s = double quote + 3x single quote+ double quote as andy d

Re: [DB-SIG] mysql string length?

2006-04-18 Thread Lukasz Szybalski
On 4/18/06, Lukasz Szybalski <[EMAIL PROTECTED]> wrote: > On 4/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > On Mon, 17 Apr 2006, Andy Todd wrote: > > > > >> stmt = "INSERT INTO table_x (body) VALUES (%s)" # [1] > > >> cursor.execute(stmt, (body,)) > > >>> [1] note that there are

Re: [DB-SIG] mysql string length?

2006-04-18 Thread Lukasz Szybalski
On 4/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Mon, 17 Apr 2006, Andy Todd wrote: > > >> stmt = "INSERT INTO table_x (body) VALUES (%s)" # [1] > >> cursor.execute(stmt, (body,)) > >>> [1] note that there are no quote marks around the %s > >> > >> this works here (debian testi

Re: [DB-SIG] mysql string length?

2006-04-18 Thread Andy Dustman
On 4/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Mon, 17 Apr 2006, Andy Todd wrote: > > >> stmt = "INSERT INTO table_x (body) VALUES (%s)" # [1] > >> cursor.execute(stmt, (body,)) > >>> [1] note that there are no quote marks around the %s > >> > >> this works here (debian testi

Re: [DB-SIG] mysql string length?

2006-04-17 Thread engelbert . gruber
On Mon, 17 Apr 2006, Andy Todd wrote: >> stmt = "INSERT INTO table_x (body) VALUES (%s)" # [1] >> cursor.execute(stmt, (body,)) >>> [1] note that there are no quote marks around the %s >> >> this works here (debian testing, python 2.3.5, 4.0.21) :: >> >> import MySQLdb >> """ >> create t

Re: [DB-SIG] mysql string length?

2006-04-17 Thread Andy Todd
[EMAIL PROTECTED] wrote: > On Sun, 16 Apr 2006, Andy Todd wrote: > >> Lukasz Szybalski wrote: >>> On Sat, 2006-04-15 at 12:01 +, Andrew Chambers wrote: * Lukasz Szybalski <[EMAIL PROTECTED]> [2006-04-14 12:00:09 -0500]: > INSERT INTO table_x( body)VALUES( '%s')" % (body) > >

Re: [DB-SIG] mysql string length?

2006-04-16 Thread engelbert . gruber
On Sun, 16 Apr 2006, Andy Todd wrote: > Lukasz Szybalski wrote: >> On Sat, 2006-04-15 at 12:01 +, Andrew Chambers wrote: >>> * Lukasz Szybalski <[EMAIL PROTECTED]> [2006-04-14 12:00:09 -0500]: >>> INSERT INTO table_x( body)VALUES( '%s')" % (body) this body is a string that vari

Re: [DB-SIG] mysql string length?

2006-04-16 Thread Andy Todd
Lukasz Szybalski wrote: > On Sat, 2006-04-15 at 12:01 +, Andrew Chambers wrote: >> * Lukasz Szybalski <[EMAIL PROTECTED]> [2006-04-14 12:00:09 -0500]: >> >>> INSERT INTO table_x( body)VALUES( '%s')" % (body) >>> >>> this body is a string that varies in size. I keep getting an error if >>> the

Re: [DB-SIG] mysql string length?

2006-04-15 Thread Lukasz Szybalski
On Sat, 2006-04-15 at 12:01 +, Andrew Chambers wrote: > * Lukasz Szybalski <[EMAIL PROTECTED]> [2006-04-14 12:00:09 -0500]: > > > INSERT INTO table_x( body)VALUES( '%s')" % (body) > > > > this body is a string that varies in size. I keep getting an error if > > the size of body is longer the

Re: [DB-SIG] mysql string length?

2006-04-15 Thread Andrew Chambers
* Lukasz Szybalski <[EMAIL PROTECTED]> [2006-04-14 12:00:09 -0500]: > INSERT INTO table_x( body)VALUES( '%s')" % (body) > > this body is a string that varies in size. I keep getting an error if > the size of body is longer then 255, and if its smaller everything > goes smooth. Is this syntax cor

Re: [DB-SIG] MySQL Access UPDATE

2005-08-10 Thread Chris Cogdon
On Aug 10, 2005, at 14:50, Brett Chadwick wrote: > All, > This is the current code I am trying to use, it is modeled after some > examples I have seen. If someone can provide a better example or way > to access the MySQL server and pull or push data to a database on the > server that would be

Re: [DB-SIG] MySQL Access UPDATE

2005-08-10 Thread Brett Chadwick
All, This is the current code I am trying to use, it is modeled after some examples I have seen. If someone can provide a better example or way to access the MySQL server and pull or push data to a database on the server that would be appreciated. ##Database name is Test, Table name is Test1,

Re: [DB-SIG] MySQL Access

2005-08-10 Thread Andy Dustman
On 8/9/05, Brett Chadwick <[EMAIL PROTECTED]> wrote: > I am attempting to access a MySQL server through a graphical python program I > have writing. > > I have successfully made a connection to the database which runs on a Linux > server, however I cannot find any syntax/command examples which r

Re: [DB-SIG] MySQL Multi-Table Insert Strategy

2005-07-06 Thread Aaron Bingham
Don Parris <[EMAIL PROTECTED]> writes: > I'm new on the list, and just had a general question about the best > approach for setting up a multi-table insert. I know that MySQL > doesn't support this outright, but would most people recommend using a > transaction? This is precisely the kind of thi

Re: [DB-SIG] MySQL Multi-Table Insert Strategy

2005-07-06 Thread Kolbe Kegel
Hi Don, > I'm new on the list, and just had a general question about the best > approach for setting up a multi-table insert. I know that MySQL > doesn't support this outright, but would most people recommend using a > transaction? This question is essentially neutral to the language-specific AP

Re: [DB-SIG] MySQL operational error

2005-01-30 Thread Andy Dustman
On Sun, 30 Jan 2005 11:50:12 -, Peter Mott <[EMAIL PROTECTED]> wrote: > OperationalError: (2005, "Unknown MySQL Server Host 'mysql4db.gradwell.net' > (2)") This is not really the right place for this question. It's the sort of thing you should use the mysql-python help forum for. https://so