db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: IRC chat summary: is there a way to find out column names in ij?
Date Fri, 07 Jul 2006 15:03:12 GMT
Knut Anders Hatlen wrote:

> "Jean T. Anderson" <jta@bristowhill.com> writes:
>>A user asked this question on #derby today (and here's a summary of the
>>chat since there are probably others on this list with the same question):
>>   Is there a way that I can find out what columns are in a table in ij?
>>   like describe tablename or something?
>>You can't do that in ij, but that feature has been logged as DERBY-1164.
> Well, actually, you *can* do that in ij, but it's not very user
> friendly. You could write a query against the system tables. To find
> out what columns are in SYS.SYSCONSTRAINTS, enter this query:
>   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;

Or if you just want the column names:

select * from MYTABLE where 1 = 0


View raw message