db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean T. Anderson" <...@bristowhill.com>
Subject Re: IRC chat summary: is there a way to find out column names in ij?
Date Fri, 07 Jul 2006 17:14:47 GMT
Thanks for the additional suggestions, Knut and Dan.

I added a ListTableColumns entry to
http://wiki.apache.org/db-derby/HintsAndTips summarizing all this.
Anyone, feel free to add more tips -- the full URL is
http://wiki.apache.org/db-derby/ListTableColumns .

cheers,

 -jean

Daniel John Debrunner wrote:
> 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
> 
> Dan.
> 
> 


Mime
View raw message