[DB-SIG] Cursor.description when Cursor.rowcount == 0

Art Protin aprotin at research.att.com
Fri Nov 10 21:55:04 CET 2006


Dear folks,
    Carsten Haese wrote:

>On Fri, 2006-11-10 at 19:03 +0100, M.-A. Lemburg wrote:
>  
>
>>It is common practice to do
>>
>>cursor.execute('select * from mytable where 1=0')
>>print cursor.description
>>    
>>
>
>I'm glad I'm not the only one doing this :)
>
>  
>
>>cursor.description always refers to a result set. If a statement
>>does not produce a result set, then .description should be None.
>>    
>>
>
>I think the DB-API spec (or a future version thereof) should replace
>"operations that do not return rows" with "operations that do not
>produce a result set" to make this point clear.
>
>-Carsten
>
>
>  
>
The DBMS that I am writing the interface for has other (more efficient) 
ways of producing this meta data.  Don't the other DBMSs ?  Should the 
spec include a method (or more) to report on tables in the DB and on 
columns in a table?  Is there a common extension that should be codified?

    Thank you all,
    Arthur Protin


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/db-sig/attachments/20061110/e15d300e/attachment.html 


More information about the DB-SIG mailing list