MySQL insert query problem

L

Lol McBride

Hi all,
I'm using Python 2.3 and the MySQLDB module on a Mandrake Linux 9.2 system
and I'm encountering a problem whentrying to insert a string object intoa
varchar field in a database I'm using. The query being sent to the MySQL
server by my program is : INSERT INTO analysis (DrawNumber,pool1)VALUES
(847, ' (4, 8, 21, 24, 39, 44) ' ) ;

But the field pool1 actually contains (4, 8, 21, 24, 39, i.e it is
missing the final digits ( 44 ) and the closing bracket.The program writes
a number of rows into the database and they all exhibit the same behaviour
- could anyone shed some light on this problem? Thanks,
Lol McBride
 
M

Mike C. Fletcher

Did you by any chance declare the field to be 19 characters wide when
creating the database? Truncating to the length of the field is, I
think, normal SQL practise.

Just a thought,
Mike

Lol McBride wrote:
....
varchar field in a database I'm using. The query being sent to the MySQL
server by my program is : INSERT INTO analysis (DrawNumber,pool1)VALUES
(847, ' (4, 8, 21, 24, 39, 44) ' ) ;

But the field pool1 actually contains (4, 8, 21, 24, 39, i.e it is
missing the final digits ( 44 )
....

_______________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://members.rogers.com/mcfletch/
 
L

Lol McBride

Did you by any chance declare the field to be 19 characters wide when
creating the database? Truncating to the length of the field is, I
think, normal SQL practise.

Just a thought,
Mike

Lol McBride wrote:
...

...

_______________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://members.rogers.com/mcfletch/
Oh yeah baby, obvious and therefore invisible to my gaze.Thank you for
opening my eyes.
Lol McBride
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,176
Messages
2,570,950
Members
47,501
Latest member
log5Sshell/alfa5

Latest Threads

Top