[DB-SIG] DB API v2.0 : how am I to get a field default value if it isn't in Cursor.description
Anthony Baxter <firstname.lastname@example.org>
Thu, 06 Mar 2003 13:06:49 +1100
>>> "Eugene P. Sizikov" wrote
> I'm using Python with MySQLdb (DB API v2.0 compatible), and surpriselly
> have not found a way to get some SQL table structural information such
> as fields DEFAULT value and fields index type (PRIMARY, FOREIGN, UNIQUE,
> MULTIPLE and so on). How am I to get that info if it isn't in
> Cursor.description? While looking into MySQL-python sources I realized
> that the info (at least default values) is just unused when the Python
> 'description' tuple is constructed.
With databases like Oracle, there are other system tables in the database
that contain this information.