db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yves pielusenet <yvespieluse...@free.fr>
Subject Re: Retreive colummn name of a table from java
Date Thu, 14 Sep 2006 22:31:43 GMT
after tests I found this statement :
ij> select columnname, columnnumber from sys.systables, sys.syscolumns where referenceid=tableid
and tablename='DATA' order by columnnumber;

which works well for me :)

do you see something wrong ?


Le jeudi 14 septembre 2006 à 15:16 -0700, Francois Orsini a écrit :
> Yes,
> 
> It all depends how you created the table - have you tried running the
> query by specifying you table name in uppercase such as:
> j> 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='DATA'
>    order by columnnumber;
> 
> _or_ you can also run "select * from sys.systables" and find out if
> your table appears in the list being retrieved...then check the actual
> table identifier (aka name)...
> 
> Hope this helps a bit,
> 
> --francois
> 
> On 9/14/06, yves pielusenet <yvespielusenet@free.fr> wrote:
>         Hello,
>         I read this :
>         http://wiki.apache.org/db-derby/ListTableColumns
>         
>         but I can't retreive the column of my table 'data'. Here is
>         what i
>         tested : 
>         ij> 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='data' 
>             order by columnnumber;
>         
>         And the result is :
>         
>         COLUMNNUMB&|COLUMNNAME|COLUMNDATATYPE
>         ------------------------------------------------------------------------------------------------------------------------------------------------------------

>         
>         0 lignes sélectionnées
>         
>         How can I do ?
>         
>         thanks,
>         
>         --
>         yves piel
>         
>         
> 


Mime
View raw message