<br><br><div class="gmail_quote">On Sat, Dec 12, 2009 at 10:54 AM, Carsten Haese <span dir="ltr"><<a href="mailto:carsten.haese@gmail.com">carsten.haese@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Victor Subervi wrote:<br>
> Hi;<br>
> I'm using MySQLdb. If I do a<br>
> cursor.execute('describe myTable;')<br>
> it gives me all sorts of data but not my default values.<br>
<br>
</div>That function call doesn't "give" any data at all, except for the<br>
rowcount (which would be the number of columns in the table). </blockquote><div><br>Really?<br><br> cursor.execute('describe %s;' % store)<br> storeDescription = cursor.fetchall()<br> print storeDescription<br>
<br>Prints out this:<br><br>(('ID', 'tinyint(5) unsigned', 'NO', 'PRI', None, 'auto_increment'),
('SKU', 'varchar(40)', 'NO', 'UNI', None, ''), ('Category',
'varchar(40)', 'YES', '', None, ''), ('Name', 'varchar(50)', 'NO', '',
None, ''), ('Title', 'varchar(100)', 'NO', '', None, ''),
('Description', 'mediumtext', 'NO', '', None, ''), ('Price',
'float(8,2)', 'YES', '', None, ''), ('SortFactor', 'int(4)', 'YES', '',
'500', ''), ('Availability', 'tinyint(1)', 'NO', '', None, ''),
('ShipFlatFee', 'float(5,2)', 'NO', '', '10.00', ''),
('ShipPercentPrice', 'tinyint(2) unsigned', 'NO', '', '5', ''),
('ShipPercentWeight', 'tinyint(2) unsigned', 'NO', '', '2', ''),
('Associations', 'varchar(40)', 'NO', '', None, ''), ('TempPrice',
'float(7,2)', 'NO', '', None, ''), ('LastDatePrice', 'date', 'NO', '',
None, ''), ('Weight', 'float(7,2)', 'NO', '', None, ''), ('Metal',
"enum('14k gold','18k gold','white
gold','silver','tungsten','titanium')", 'NO', '', None, ''),
('PercentMetal', 'tinyint(2) unsigned', 'NO', '', None, ''), ('pic1',
'blob', 'YES', '', None, ''), ('pic2', 'blob', 'YES', '', None, ''),
('sizes',
"set('Extra-small','Small','Medium','Large','XLarge','XXLarge','XXXLarge')",
'YES', '', None, ''), ('colorsShadesNumbersShort',
"set('blue:333399','gray:465945','purple:50404D','navy-blue:CC7722','fuchsia:FF77FF','aqua:7FFFD4','maroon:B03060','black:0000FF','yellow:9ACD32','teal:E2725B','olive:6B8E23','green:00A550','white:0F4D92','silver:708090','red:FE2712','lime:32CD32')",
'YES', '', None, ''))
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In my version of MySQL, he default value is in the fifth column of the<br>
result set.<br></blockquote><div><br>Nice. As you can see, I only get 4 columns by default. How do I get the fifth?<br>TIA,<br>V<br></div></div>