Error when inserting into MySQL database
Hello, I get a very serious error when trying to insert into my database: Zope Error Zope has encountered an error while publishing this resource. Error Type: error Error Value: Duplicate entry '127' for key 1 Troubleshooting Suggestions The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience. Traceback (innermost last): File /usr/local/Zope-2.3.0-linux2-x86/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/Zope-2.3.0-linux2-x86/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/Zope-2.3.0-linux2-x86/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/Zope-2.3.0-linux2-x86/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/Zope-2.3.0-linux2-x86/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: index_html) File /usr/local/Zope-2.3.0-linux2-x86/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: index_html) File /usr/local/Zope-2.3.0-linux2-x86/lib/python/OFS/DTMLMethod.py, line 189, in __call__ (Object: index_html) File /usr/local/Zope-2.3.0-linux2-x86/lib/python/DocumentTemplate/DT_String.py, line 538, in __call__ (Object: index_html) File /usr/local/Zope-2.3.0-linux2-x86/lib/python/DocumentTemplate/DT_With.py, line 146, in render (Object: portal_properties) File /usr/local/Zope-2.3.0-linux2-x86/lib/python/DocumentTemplate/DT_With.py, line 146, in render (Object: admin) File /usr/local/Zope-2.3.0-linux2-x86/lib/python/OFS/DTMLDocument.py, line 182, in __call__ (Object: index) File /usr/local/Zope-2.3.0-linux2-x86/lib/python/DocumentTemplate/DT_String.py, line 538, in __call__ (Object: index) File /usr/local/Zope-2.3.0-linux2-x86/lib/python/OFS/DTMLMethod.py, line 182, in __call__ (Object: dspDisplayArchive) File /usr/local/Zope-2.3.0-linux2-x86/lib/python/DocumentTemplate/DT_String.py, line 538, in __call__ (Object: dspDisplayArchive) File /usr/local/Zope-2.3.0-linux2-x86/lib/python/DocumentTemplate/DT_In.py, line 713, in renderwob (Object: sqlGetArchive(id=archiveid)) File /usr/local/Zope-2.3.0-linux2-x86/lib/python/OFS/DTMLMethod.py, line 182, in __call__ (Object: fncDisplayClips) File /usr/local/Zope-2.3.0-linux2-x86/lib/python/DocumentTemplate/DT_String.py, line 538, in __call__ (Object: fncDisplayClips) File /usr/local/Zope-2.3.0-linux2-x86/lib/python/Shared/DC/ZRDB/DA.py, line 489, in __call__ (Object: sqlAddClip) File /usr/local/Zope-2.3.0-linux2-x86/lib/python/Products/ZMySQLDA/db.py, line 171, in query error: (see above) Okay - I have tried to delete the record in the database with id=127. Then I could insert one more record and then the error happens again. WHY ???? The id field is auto_incremented ... and the type is tinyint ... Anyone who have any ideas ??? Regards, -- ************************ Gitte Wange Jensen System Squid Developer MMManager Aps +45 29 72 79 72 gitte@mmmanager.org ************************
At 5/8/01 10:32 AM, Gitte Wange wrote:
The id field is auto_incremented ... and the type is tinyint ... Anyone who have any ideas ???
And a tinyint can be -127 to +127. If you want more records than 127, make the id field some bigger type of integer. As it is, you are getting just what you asked for. -- Dennis Nichols nichols@tradingconnections.com
On Tuesday 08 May 2001 15:11, Dennis Nichols wrote:
At 5/8/01 10:32 AM, Gitte Wange wrote:
The id field is auto_incremented ... and the type is tinyint ... Anyone who have any ideas ???
And a tinyint can be -127 to +127. If you want more records than 127, make the id field some bigger type of integer. As it is, you are getting just what you asked for.
-- Dennis Nichols nichols@tradingconnections.com
Well I found out :-)) Now I am not good at binay numbers. Is there a list somewhere on the internet where I can see how many bits numbers use ? Regards -- ************************ Gitte Wange Jensen System Squid Developer MMManager Aps +45 29 72 79 72 gitte@mmmanager.org ************************
Hi Gitte,
Well I found out :-))
Now I am not good at binay numbers. Is there a list somewhere on the internet where I can see how many bits numbers use ?
Not on internet as such. This is only a naming issue and depends on the application. In this case you will find it in your database documentation. Regards Tino Wildenhain
Now I am not good at binay numbers. Is there a list somewhere on the internet where I can see how many bits numbers use ?
went to www.google.com and did a search on "mysql field type size" First link was http://www.scibit.com/Help/Mascon/masconMySQL_Field_Types.html
Now I am not good at binay numbers. Is there a list somewhere on the internet where I can see how many bits numbers use ?
This info is also in the O'Reilly book MySQL & mSQL starting on page 235. (The orange post-it flag in my copy.)
participants (4)
-
Dennis Nichols -
Gitte Wange -
Steve Drees -
Tino Wildenhain