ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> db-sig
db-sig
Re: [DB-SIG] mysql string length?
by Lukasz Szybalski other posts by this author
Apr 15 2006 3:25PM messages near this date
Re: [DB-SIG] mysql string length? | Re: [DB-SIG] mysql string length?
On Sat, 2006-04-15 at 12:01 +0000, Andrew Chambers wrote:
>  * Lukasz Szybalski <szybalski@[...].com> [2006-04-14 12:00:09 -0500]:
>  
>  > INSERT INTO table_x( body)VALUES( '%s')" %  (body)
>  > 
>  > this body is a string that varies in size. I keep getting an error if
>  > the size of body is longer then 255, and if its smaller everything
>  > goes smooth. Is this syntax correct? should '%s' be something else?
>  
>  What is the datatype of body?  It sounds like it is CHAR(255).  Can you
>  change this to be TEXT?
>  
Yes it is text. 
mysql>  describe table_x;
+----------+---------+------+-----+---------+-------+
| Field    | Type    | Null | Key | Default | Extra |
+----------+---------+------+-----+---------+-------+
| id | int(11) |      | PRI | 0       |       |
| body     | text    | YES  |     | NULL    |       |
+----------+---------+------+-----+---------+-------+

Would some kind of characters that are passed in had something to do
with the error, maybe EOF or something similar?

The string that is passed in is from xml node. For debugging i made it
return str(body), but that didn't change anything. 

Are there any other database/%s related requirements?

Lukasz 


>  Regards,
>  Andy
>  
>  Send instant messages to your online friends http://uk.messenger.yahoo.com 
>  _______________________________________________
>  DB-SIG maillist  -  DB-SIG@[...].org
>  http://mail.python.org/mailman/listinfo/db-sig

_______________________________________________
DB-SIG maillist  -  DB-SIG@[...].org
http://mail.python.org/mailman/listinfo/db-sig
Thread:
Lukasz Szybalski
Andrew Chambers
Lukasz Szybalski
Andy Todd
Engelbert Gruber
Andy Todd
Engelbert Gruber
Lukasz Szybalski
Lukasz Szybalski
Andy Todd
Lukasz Szybalski
M.-A. Lemburg
Ian Bicking
Gerhard Häring
Ian Bicking
Carsten Haese
Gerhard Häring
Carsten Haese
Carsten Haese
Python
Engelbert Gruber
Andy Dustman

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved