Re: Another MySQL Problem

2010-06-26 Thread Victor Subervi
On Fri, Jun 25, 2010 at 2:15 AM, Dennis Lee Bieber wrote: > On Thu, 24 Jun 2010 09:59:41 -0430, Victor Subervi > declaimed the following in > gmane.comp.python.general: > >I could have sworn the concept had been brought up some 8 months > ago... Probably couched in relational database ter

Re: Another MySQL Problem

2010-06-24 Thread Victor Subervi
On Thu, Jun 24, 2010 at 9:34 AM, Stephen Hansen wrote: > On Thu, Jun 24, 2010 at 4:47 AM, Victor Subervi > wrote: > >> On Thu, Jun 24, 2010 at 1:56 AM, John Nagle wrote: >> > Yes. Please post your CREATE statements, so we can see your >>> database schema. If you really have one table per c

Re: Another MySQL Problem

2010-06-24 Thread Stephen Hansen
On Thu, Jun 24, 2010 at 4:47 AM, Victor Subervi wrote: > On Thu, Jun 24, 2010 at 1:56 AM, John Nagle wrote: > Yes. Please post your CREATE statements, so we can see your >> database schema. If you really have one table per client, you're >> doing it wrong. >> > > cursor.execute('create tabl

Re: Another MySQL Problem

2010-06-24 Thread Victor Subervi
On Thu, Jun 24, 2010 at 1:56 AM, John Nagle wrote: > On 6/23/2010 10:59 PM, Dennis Lee Bieber wrote: > >> On Wed, 23 Jun 2010 11:58:24 -0430, Victor Subervi >> declaimed the following in >> gmane.comp.python.general: >> >> >> When I have this code: >>> >> > > >>And yes -- it IS an

Re: Another MySQL Problem

2010-06-23 Thread John Nagle
On 6/23/2010 10:59 PM, Dennis Lee Bieber wrote: On Wed, 23 Jun 2010 11:58:24 -0430, Victor Subervi declaimed the following in gmane.comp.python.general: When I have this code: And yes -- it IS an error... You are AGAIN trying to use parameters for SCHEMA entities, not data.

Re: Another MySQL Problem

2010-06-23 Thread Stephen Hansen
On Jun 23, 2010, at 11:20 AM, Victor Subervi wrote: On Wed, Jun 23, 2010 at 12:51 PM, Stephen Hansen wrote: > The problem is not this line but: > > > File "/var/www/html/globalsolutionsgroup.vi/mailSpreadsheet.py", line > 38, in mailSpreadsheet > cursor.execute('select * from %s', (client

Re: Another MySQL Problem

2010-06-23 Thread Victor Subervi
On Wed, Jun 23, 2010 at 12:51 PM, Stephen Hansen wrote: > The problem is not this line but: > > > File "/var/www/html/globalsolutionsgroup.vi/mailSpreadsheet.py", line > 38, in mailSpreadsheet > cursor.execute('select * from %s', (client,)) > > > This one. > Yes, can't use the comma, must

Re: Another MySQL Problem

2010-06-23 Thread Stephen Hansen
On Jun 23, 2010, at 9:28 AM, Victor Subervi wrote: Ok, let's start all over again. When I have this code: cursor.execute('select clientEmail from clients where client="%s"', (client.replace('_', ' '),)) clientEmail = cursor.fetchone()[0] Already addressed this. Do not quote inside the SQL.

Re: Another MySQL Problem

2010-06-23 Thread Stephen Hansen
On Jun 23, 2010, at 9:12 AM, Paul Rubin wrote: Stephen Hansen writes: On 6/23/10 6:45 AM, Victor Subervi wrote: cursor.execute('select clientEmail from clients where client=%s', ... Do, 'client.replace("_", " ")' instead. Er, look what happened to Little Bobby Tables (a quick web search on

Re: Another MySQL Problem

2010-06-23 Thread Victor Subervi
Ok, let's start all over again. When I have this code: cursor.execute('select clientEmail from clients where client="%s"', (client.replace('_', ' '),)) clientEmail = cursor.fetchone()[0] I get this error: /var/www/html/globalsolutionsgroup.vi/mailSpreadsheet.py 67 68 ''' 69 70

Re: Another MySQL Problem

2010-06-23 Thread Tim Chase
On 06/23/2010 08:45 AM, Victor Subervi wrote: Hi; I have this line: cursor.execute('select clientEmail from clients where client=%s', (string.replace(client, '_', ' '))) clientEmail = cursor.fetchone()[0] cursor.execute('select * from %s' % (client)) client = "Lincoln_Properties" With

Re: Another MySQL Problem

2010-06-23 Thread Tapi
On Wed, 23 Jun 2010 10:46:37 -0430, Victor Subervi wrote: > On Wed, Jun 23, 2010 at 10:25 AM, Stephen Hansen > wrote: > >> On 6/23/10 6:45 AM, Victor Subervi wrote: >> > Hi; >> > I have this line: >> > >> > cursor.execute('select clientEmail from clients where client=%s', >> > (string.replace(c

Re: Another MySQL Problem

2010-06-23 Thread Paul Rubin
Stephen Hansen writes: >On 6/23/10 6:45 AM, Victor Subervi wrote: >> cursor.execute('select clientEmail from clients where client=%s', ... > Do, 'client.replace("_", " ")' instead. Er, look what happened to Little Bobby Tables (a quick web search on his name should find his story) because someo

Re: Another MySQL Problem

2010-06-23 Thread Simon Malinge
On Wed, 23 Jun 2010 10:46:37 -0430, Victor Subervi wrote: > On Wed, Jun 23, 2010 at 10:25 AM, Stephen Hansen > wrote: > >> On 6/23/10 6:45 AM, Victor Subervi wrote: >> > Hi; >> > I have this line: >> > >> > cursor.execute('select clientEmail from clients where client=%s', >> > (string.replace(c

Re: Another MySQL Problem

2010-06-23 Thread Stephen Hansen
On 6/23/10 8:16 AM, Victor Subervi wrote: > On Wed, Jun 23, 2010 at 10:25 AM, Stephen Hansen > mailto:pyt...@ixokai.io>> wrote: > > On 6/23/10 6:45 AM, Victor Subervi wrote: > > Hi; > > I have this line: > > > > cursor.execute('select clientEmail from clients where client=%s'

Re: Another MySQL Problem

2010-06-23 Thread Victor Subervi
On Wed, Jun 23, 2010 at 10:25 AM, Stephen Hansen wrote: > On 6/23/10 6:45 AM, Victor Subervi wrote: > > Hi; > > I have this line: > > > > cursor.execute('select clientEmail from clients where client=%s', > > (string.replace(client, '_', ' '))) > > clientEmail = cursor.fetchone()[0] > > curso

Re: Another MySQL Problem

2010-06-23 Thread Stephen Hansen
On 6/23/10 6:45 AM, Victor Subervi wrote: > Hi; > I have this line: > > cursor.execute('select clientEmail from clients where client=%s', > (string.replace(client, '_', ' '))) > clientEmail = cursor.fetchone()[0] > cursor.execute('select * from %s' % (client)) > > client = "Lincoln_Properti

Re: Another MySQL Problem

2009-12-18 Thread John Nagle
MRAB wrote: Victor Subervi wrote: Hi; mysql> truncate tem126072414516; Query OK, 0 rows affected (0.00 sec) Then I run a script: if whatDo == 'insert': try: sql = 'insert into %s (ProdID, Quantity) values ("%s", "%s");' % (tmpTable, prodid, quantity) print sql cursor

Re: Another MySQL Problem

2009-12-13 Thread Victor Subervi
On Sun, Dec 13, 2009 at 1:37 PM, MRAB wrote: > 2. Did you commit the changes? > Ah, yes, caught me napping! db.commit() has bit me in the a$$ again. Thanks, V -- http://mail.python.org/mailman/listinfo/python-list

Re: Another MySQL Problem

2009-12-13 Thread MRAB
Victor Subervi wrote: Hi; mysql> truncate tem126072414516; Query OK, 0 rows affected (0.00 sec) Then I run a script: if whatDo == 'insert': try: sql = 'insert into %s (ProdID, Quantity) values ("%s", "%s");' % (tmpTable, prodid, quantity) print sql cursor.execute(sql)