db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Db-derby Wiki] Update of "ListTableColumns" by jeanTanderson
Date Fri, 07 Jul 2006 17:12:28 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.

The following page has been changed by jeanTanderson:

The comment on the change is:
Adding new page about displaying column info for a table

New page:
This page lists various ways to output information about the columns in a table.

== Using ij ==

If all you want is to output the column names, the query below executed in {{{ij}}} shows
how to do that for a table named ''my_table'':

ij> select * from my_table where 1=2;

You can obtain more details by querying the system catalogs. The query below outputs information
the columns in the {{{SYS.SYSCONSTRAINTS}}} table:

select columnnumber, columnname, columndatatype
    from sys.systables t, sys.syscolumns, sys.sysschemas s
    where tableid=referenceid and t.schemaid=s.schemaid
      and schemaname='SYS' and tablename='SYSCONSTRAINTS'
    order by columnnumber;

[http://issues.apache.org/jira/browse/DERBY-1164 DERBY-1164] is an enhancement request to
add {{{show tables}}} and {{{describe}}} commands to {{{ij}}}.

== Using dblook ==

The {{{dblook}}} utility lets you extract the schema for a database or a table in that database.
 {{{dblook}}} is documented in the [http://db.apache.org/derby/docs/10.1/tools/ctoolsdblook.html
''Derby Tools and Utilities Guide''], which also provides handy [http://db.apache.org/derby/docs/10.1/tools/rtoolsdblookexamples.html

View raw message