On Mon, Jul 31, 2006 at 09:47:40PM -0400, John D. Burger wrote:
> >never, never, never try quoting on your own! You can only fail. The
> >only choice is to fail now or later.
>
> Nonetheless, in case it's useful, here's a barebones wrapper I call on
> everything:
It'll work fine on single byte
On Jul 31 10:40, Parthan SR wrote:
> On 7/31/06, Richard Huxton wrote:
> Traceback (most recent call last): File
> "/usr/lib/cgi-bin/ConfSachem/page2.py", line 75, in ? main(num_days) File
> "/usr/lib/cgi-bin/ConfSachem/page2.py", line 68, in main query =
> cursor.execute('INSERT INTO ConfMain (Co
Hii,With regards to the previous mail and replaies, I tried with this code. Although it doesn't give any error when i run it as a script, but the
return value is NONE for 'q', which is assigned to return value of
cursor.execute(), and the data are not inserted into the database.
[code]
name =
never, never, never try quoting on your own! You can only fail. The
only choice is to fail now or later.
Nonetheless, in case it's useful, here's a barebones wrapper I call on
everything:
def sqlValue (value):
if value is None:
return "NULL"
elif type(value) == types.StringType:
Parthan,never, never, never try quoting on your own! You can only fail. The only choice is to fail now or later.The only recommended way with Python and DBAPI2.0 is:lala="huibuh"cs.execute
("select bla from foo where schupp=%s", (lala,))or bettercs.execute ("select bla from foo where schupp=%(lala
Parthan wrote:
Hello,
Am not sure whether i can post such a question over here, still the
error is in my postgresql query syntax, hence i post it in this
mailing list. sorry if am wrong.
I am getting a 'type error' with the following query.
[Code]
Line68:
query = cursor.execute("""INSERT I
Line68:
query = cursor.execute("""INSERT INTO ConfMain (ConfName, ConfHost,
ConfStart, ConfEnd, ConfDays, ConfStartTime, ConfEndTime, ConfSize)
VALUES (\'%s\', \'%s\', \'%%\', \'%%\', %i, \'%%\', \'%%\', %i);""" %
(conf_name, host_name, start_day, end_day, int(num_days), start_time,
end_time, au
On 7/31/06, Richard Huxton wrote:
> Line68:> query = cursor.execute("""INSERT INTO ConfMain (ConfName, ConfHost,> ConfStart, ConfEnd, ConfDays, ConfStartTime, ConfEndTime, ConfSize)> VALUES (\'%s\', \'%s\', \'%%\', \'%%\', %i, \'%%\', \'%%\', %i);""" %
> (conf_name, host_name, st
Parthan wrote:
Hello,
Am not sure whether i can post such a question over here, still the
error is in my postgresql query syntax, hence i post it in this mailing
list. sorry if am wrong.
I am getting a 'type error' with the following query.
[Code]
Line68:
query = cursor.execute("""INSERT I
Hello,
Am not sure whether i can post such a question over here, still the
error is in my postgresql query syntax, hence i post it in this mailing
list. sorry if am wrong.
I am getting a 'type error' with the following query.
[Code]
Line68:
query = cursor.execute("""INSERT INTO ConfMain (Co
10 matches
Mail list logo