Ed Leafe wrote: > On Jan 9, 2007, at 9:19 AM, johnf wrote: > >> Also I'm not to sure normal users have access to the >> "information_schema". I >> only know that access is assumed OK on public "sysobjects tables". > > Even if they have complete unfettered access to information_schema, > what good would it do for this query? > > select sum(orderitems.amount) as totalsales, ... > > Where will information_schema have anything about the 'totalsales' > column in your cursor? > > Use the dbapi, Luke!
Ed is completely correct. Is the needed information not in cursor.description after running the query? You can use the field information from the backend table sometimes. You can use the field information from the cursor.description all the time.[1] In my branch I recently overhauled how the DataStructure is gotten. It should be generic enough for all backends, as long as they conform to dbapi2.[2] [1] A notable exception to this is sqlite, which doesn't provide any field information - your application needs to know this information for itself and set DataStructure explicitly. [2] The generic getStructureDescription() still calls the backend-specific getFields() as a secondary way to get the field information if it wasn't able to be gotten from the cursor.description directly. This would be the case in sqlite, which doesn't report any type information in cursor.description, but yet if we are talking about fields from a backend table, getFields() for sqlite has code to guess at the correct types which is better than nothing. -- pkm ~ http://paulmcnett.com _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
