Extracting DB schema (newbie Q)
John Gordon
gordon at panix.com
Mon May 14 13:05:17 EDT 2012
In <bca2r7dt23l49ovp7m7id1ap3iaccvk7pe at 4ax.com> Steve Sawyer <ssawyer at stephensawyer.com> writes:
> What I think I want to do is to construct a dictionary using the
> column names as the index value, and a list containing the various
> attributes (data type, lenghth, precision).
If you're using just the column name as the dictionary key, make sure
there are no duplicate column names among all your tables.
> If this is a good approach, I ran into a problem populating the
> dictionary as I couldn't seem to figure out how to make the update()
> method work by passing the name property of the row object; I kept
> getting a "keyword can't be an expression" error.
The general syntax for assigning to a dictionary is:
my_dictionary[key] = value
What are you trying that isn't working?
--
John Gordon A is for Amy, who fell down the stairs
gordon at panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
More information about the Python-list
mailing list