Re: Error on insert statement...

2002-06-22 Thread Paul DuBois

At 17:30 -0400 6/21/02, Michael Jessop wrote:
Can someone tell me what this means?  I mean, I guess I *know* what it
means, but why?

Placeholders for Python scripts using MySQLdb should be %s, not ?.
Convert your ? characters to %s and see what happens.


The insert statement into a mysql database is...

'insert into works values(?, ?, ?, ?, ? ,?)'

The invocation of the dynamic sql is...

 status = cur_mysql.execute(sql,
 (wrk_inst, ZERO, trs_inst, aas_inst, title, NADA))

(ZERO = 0L and NADA = 'N/A')

I do a print of the wrk_inst, trs_inst, aas_inst (and zero and nada)
followed by a print of title before the error...

80956 177802 0 0 N/A
WANTED ... A BROTHER

...here is the error...

Exception in Tkinter callback
Traceback (most recent call last):
   File C:\Python22\lib\lib-tk\Tkinter.py, line 1292, in __call__
 return apply(self.func, args)
   File C:\Documents and Settings\mjessop\My Documents\Python
Development\Catalo
g\catalog_gui.py, line 82, in engage
 catalog.extract_works()
   File C:\Documents and Settings\mjessop\My Documents\Python
Development\Catalo
g\catalog_model.py, line 249, in extract_works
 (wrk_inst, ZERO, trs_inst, aas_inst, title, NADA))
   File C:\Python22\Lib\site-packages\MySQLdb\cursors.py, line 70, in
execute
 raise ProgrammingError, m.args[0]
ProgrammingError: not all arguments converted

==
here is a description of the database table...

mysql describe works
 - ;
+--+--+--+-+-+---+
| Field| Type | Null | Key | Default | Extra |
+--+--+--+-+-+---+
| wrk_inst | int(11)  |  | MUL | 0   |   |
| sinker   | int(11)  |  | MUL | 0   |   |
| trs_inst | int(11)  | YES  | | 0   |   |
| aas_inst | int(11)  | YES  | | 0   |   |
| title| varchar(255) | YES  | | NULL|   |
| pub_name | varchar(80)  | YES  | | NULL|   |
+--+--+--+-+-+---+
6 rows in set (0.03 sec)

Any thoughts?

Thank you, in advance...

+++-+++--+++
+ Michael S. Jessop+
| Senior Web Developer |
+ Copyright Clearance Center, Inc. +
+++-+++--+++


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Error on insert statement...

2002-06-21 Thread Michael Jessop

Can someone tell me what this means?  I mean, I guess I *know* what it
means, but why?

The insert statement into a mysql database is...

'insert into works values(?, ?, ?, ?, ? ,?)'

The invocation of the dynamic sql is...

status = cur_mysql.execute(sql, 
(wrk_inst, ZERO, trs_inst, aas_inst, title, NADA))

(ZERO = 0L and NADA = 'N/A')

I do a print of the wrk_inst, trs_inst, aas_inst (and zero and nada)
followed by a print of title before the error...

80956 177802 0 0 N/A
WANTED ... A BROTHER

...here is the error...

Exception in Tkinter callback
Traceback (most recent call last):
  File C:\Python22\lib\lib-tk\Tkinter.py, line 1292, in __call__
return apply(self.func, args)
  File C:\Documents and Settings\mjessop\My Documents\Python
Development\Catalo
g\catalog_gui.py, line 82, in engage
catalog.extract_works()
  File C:\Documents and Settings\mjessop\My Documents\Python
Development\Catalo
g\catalog_model.py, line 249, in extract_works
(wrk_inst, ZERO, trs_inst, aas_inst, title, NADA))
  File C:\Python22\Lib\site-packages\MySQLdb\cursors.py, line 70, in
execute
raise ProgrammingError, m.args[0]
ProgrammingError: not all arguments converted

==
here is a description of the database table...

mysql describe works
- ;
+--+--+--+-+-+---+
| Field| Type | Null | Key | Default | Extra |
+--+--+--+-+-+---+
| wrk_inst | int(11)  |  | MUL | 0   |   |
| sinker   | int(11)  |  | MUL | 0   |   |
| trs_inst | int(11)  | YES  | | 0   |   |
| aas_inst | int(11)  | YES  | | 0   |   |
| title| varchar(255) | YES  | | NULL|   |
| pub_name | varchar(80)  | YES  | | NULL|   |
+--+--+--+-+-+---+
6 rows in set (0.03 sec)

Any thoughts?

Thank you, in advance...

+++-+++--+++
+ Michael S. Jessop+
| Senior Web Developer |
+ Copyright Clearance Center, Inc. +
+++-+++--+++

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php