db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendleton.de...@gmail.com>
Subject Re: How to count the number of columns in a table.
Date Wed, 26 May 2010 12:34:23 GMT
>          How can I count the number of columns in a table using an "ij"

You could query the system catalogs. Something like:

select count(*) from SYS.SYSTABLES, SYS.SYSCOLUMNS
        where SYS.SYSTABLES.TABLEID=SYS.SYSCOLUMNS.REFERENCEID
          and SYS.SYSTABLES.TABLENAME = 'MY-TABLE-NAME';

thanks,

bryan

Mime
View raw message