[DB-SIG] Dumping Table Schema

Paul DuBois paul@dubois.ws
Tue, 5 Dec 2000 08:18:12 -0600

At 7:10 PM -0500 12/1/00, Jonan Santiago wrote:
>Thanks both for your tips. Just what I needed. Now I dont know
>why "select * from table where 1=0" works but it works!

Per the original question, my understanding (from some discussion a
while back on the DBI mailing list) is that this actually isn't
completely portable.  Although it works for many database engines, it
doesn't work for all.  Sorry, don't know any examples where it doesn't
work. I do know it does work for MySQL.

>Eugene V . Dvurechenski (jno@glasnet.ru) wrote:
>>  i believe, the only _portable_ way is to
>>	1) cursor.execute( "select * from table where 1=0" )
>>	2) use cursor.description
>>  anything else is tightly bound to the specific DBMS (all those
>>  SYS.ALL_* views in Oracle, for instance)
>>  -jno
>DB-SIG maillist  -  DB-SIG@python.org