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
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
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
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
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.
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
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
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.
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
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
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
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
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
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
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'
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
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
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 the replacement, the interpreter complains that myd
Tim,
> The underscore is a valid variable-name, idiomatically used for "I don't care
> about this", often seen in places like tuple assignment:
The underscore is also used as an alias for gettext.gettext or
gettext.ugettext so you may want to use another variable-name.
Malcolm
--
http://mail.p
On Thu, May 27, 2010 at 5:47 PM, Tim Chase wrote:
> On 05/27/2010 03:32 PM, Victor Subervi wrote:
>
> On Thu, May 27, 2010 at 1:15 PM, Tim Chase wrote:
>>
>>> That should be:
', '.join(['%s'] * len(values)))
>>>
>>> Or as I've done in the past:
>>>
>>> ', '.join('%s' for _
On 05/27/2010 03:32 PM, Victor Subervi wrote:
On Thu, May 27, 2010 at 1:15 PM, Tim Chase wrote:
That should be:
', '.join(['%s'] * len(values)))
Or as I've done in the past:
', '.join('%s' for _ in values)
Huh? Can you describe that underscore to me? Fascinating!
The underscor
On Thu, May 27, 2010 at 1:15 PM, Tim Chase wrote:
> On 05/27/2010 11:56 AM, MRAB wrote:
>
>> Kushal Kumaran wrote:
>>
>>>', '.join('%s' * len(values)))
>>>
>>
>> That should be:
>>
>> ', '.join(['%s'] * len(values)))
>>
>
> Or as I've done in the past:
>
> ', '.join('%s' for _ in
On 05/27/2010 11:56 AM, MRAB wrote:
Kushal Kumaran wrote:
', '.join('%s' * len(values)))
That should be:
', '.join(['%s'] * len(values)))
Or as I've done in the past:
', '.join('%s' for _ in values)
-tkc
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, May 27, 2010 at 12:56 PM, MRAB wrote:
> Kushal Kumaran wrote:
> [snip]
>
> Since I'm in a good mood today, here's a little present:
>>
>> def insert(cursor, table, columns, values):
>>"""Insert a row into a table. columns must be a list of column
>>names. values must be a list
On Thu, 2010-05-27 at 17:56 +0100, MRAB wrote:
> Kushal Kumaran wrote:
> [snip]
> > Since I'm in a good mood today, here's a little present:
> >
> > def insert(cursor, table, columns, values):
> > """Insert a row into a table. columns must be a list of column
> > names. values must be a
Kushal Kumaran wrote:
[snip]
Since I'm in a good mood today, here's a little present:
def insert(cursor, table, columns, values):
"""Insert a row into a table. columns must be a list of column
names. values must be a list of values for the new row. The
columns and values must corr
On Thu, May 27, 2010 at 12:11 PM, Kushal Kumaran
wrote:
> Since I'm in a good mood today, here's a little present:
>
> def insert(cursor, table, columns, values):
>"""Insert a row into a table. columns must be a list of column
>names. values must be a list of values for the new row. The
On Thu, 2010-05-27 at 20:47 +0530, Kushal Kumaran wrote:
> On Thu, 2010-05-27 at 10:30 -0400, Victor Subervi wrote:
> > On Thu, May 27, 2010 at 10:17 AM, Kushal Kumaran
> > wrote:
> >
> > On Thu, 2010-05-27 at 08:34 -0400, Victor Subervi wrote:
> > > Hi;
> > > I ha
On Thu, 2010-05-27 at 10:30 -0400, Victor Subervi wrote:
> On Thu, May 27, 2010 at 10:17 AM, Kushal Kumaran
> wrote:
>
> On Thu, 2010-05-27 at 08:34 -0400, Victor Subervi wrote:
> > Hi;
> > I have this code:
> >
> > sql = "insert into %s (%s) va
On Thu, May 27, 2010 at 10:17 AM, Kushal Kumaran
wrote:
> On Thu, 2010-05-27 at 08:34 -0400, Victor Subervi wrote:
> > Hi;
> > I have this code:
> >
> > sql = "insert into %s (%s) values ('%%s');" % (personalDataTable,
> > string.join(cols[1:], ', '))
> > #cursor.execute(sql, string.join(v
On Thu, 2010-05-27 at 09:34 -0400, Victor Subervi wrote:
> On Thu, May 27, 2010 at 8:34 AM, Victor Subervi
> wrote:
> Hi;
> I have this code:
>
> sql = "insert into %s (%s) values ('%%s');" %
> (personalDataTable, string.join(cols[1:], ', '))
>
On Thu, 2010-05-27 at 08:34 -0400, Victor Subervi wrote:
> Hi;
> I have this code:
>
> sql = "insert into %s (%s) values ('%%s');" % (personalDataTable,
> string.join(cols[1:], ', '))
> #cursor.execute(sql, string.join(vals[1:], "', '"))
> cursor.execute('insert into %s (%s) values ("%
On Thu, May 27, 2010 at 8:34 AM, Victor Subervi wrote:
> Hi;
> I have this code:
>
> sql = "insert into %s (%s) values ('%%s');" % (personalDataTable,
> string.join(cols[1:], ', '))
> #cursor.execute(sql, string.join(vals[1:], "', '"))
> cursor.execute('insert into %s (%s) values ("%s"
Hi;
I have this code:
sql = "insert into %s (%s) values ('%%s');" % (personalDataTable,
string.join(cols[1:], ', '))
#cursor.execute(sql, string.join(vals[1:], "', '"))
cursor.execute('insert into %s (%s) values ("%s");' %
(personalDataTable, string.join(cols[1:], ', '), string.join(va
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
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
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)
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)
that runs this (printed
38 matches
Mail list logo