MySQL Problem

Victor Subervi victorsubervi at
Fri Sep 3 14:21:55 CEST 2010

On Thu, Sep 2, 2010 at 3:02 PM, Ian <hobson42 at> wrote:

>  On 02/09/2010 19:34, Victor Subervi wrote:
>> for some reason running the command through python *omits* this one data!!
>> The only difference is that a flag in spreadsheets (Temp) is set to 1. Why
>> on earth doesn't it work in python??
> Some ideas to follow up.  (These are only guesses).
> 1) One of the enum type fields contains an invalid value (perhaps a value
> removed from the column definition).

There are no enum type fields.

> 2) The second id field ( appears to be very large. I wonder
> what would happen if it was larger than the auto-increment value?

It's not an ID field. It doesn't auto_increment.

> 3) A field in the one of the rows in the missing data contains bytes that
> are invalid in the character encoding you are using in python.

I changed the only bytes I thought might affect it. Furthermore, I
successfully added the blasted data to that field so it would show up in the
spreadsheet through another form. More on that later.

> 4) The python field type used for some column in the missing row, contains
> a value that cannot be held in the python variable assigned.

If that were so, none of the data would show up.

Please look at this comparison:

ID        609                161
Client        Lincoln_Properties        Lincoln_Properties
Multi        0                0
Item        2030572                40x48Green
Markup        0.00                99.32
Temp        1                Null
ID        343                37
Item        2030572                40x48Green
Description    Americo 20" Beige Floor Pad    Green Can Liners
UOM        5/cs                1000/cs
Cost        15.88                17.56
ID        335                37
ProductsID    343                37
CategoryID    49                23
ID        49                23
Category    Mats                Can Liners
Parent        Restaurant Paper/Pla        Bags

I have changed the value of Temp to Null and Markup to 11.11 to see if that
would somehow make a difference. It didn't. Then I used my TTW form for
adding data "regularly" to spreadsheets and it worked. The form I'm testing
enables the client to add data himself. The code is the same in both cases:

cursor.execute('insert into spreadsheets values (Null, %s, 0, %s, 0, Null)',
(client, prod))

cursor.execute('insert into spreadsheets values (Null, %s, 0, %s, 0, Null)',
(client, product[1]))

I checked permissions and changed ownership to make the two scripts
identical. Again, the data gets entered into MySQL just
doesn't show up with the rest of the data in the TTW form!! Why??

> Regards
> Ian
> --
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list