You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by amadis <pe...@gmail.com> on 2007/06/23 19:20:24 UTC

how to select all table names of some database in derby?

Hi, derby-user 
   
   i created a table in derby, but i forgot the name of the table, is there any sql that can show all the names out?
   
   
amadis 
2007-06-24 

Re: Re: how to select all table names of some database in derby?

Posted by amadis <pe...@gmail.com>.
Hi, Derby Discussion    

SYS.SYSTABLES has all the system tables, what i am looking for is the name list of specific tables i created.

amadis    
2007-06-24      
----- Original Message -----      
From:   Peter Ondruska      
To:   Derby Discussion      
Sent:  2007-06-24, 01:35:04     
Subject:  Re: how to select all table names of some database in derby?     



     
>http://db.apache.org/derby/docs/10.2/ref/rrefsistabs24269.html 
> 
>SYS.SYSTABLES table has all database tables 
> 
>On 23.6.2007, at 19:20, amadis wrote: 
> 
>> Hi, derby-user 
>> 
>>    i created a table in derby, but i forgot the name of the table,   
>> is there any sql that can show all the names out? 
>> 
>> 
>> amadis 
>> 2007-06-24 
> 

Re: how to select all table names of some database in derby?

Posted by Peter Ondruska <pe...@gmail.com>.
http://db.apache.org/derby/docs/10.2/ref/rrefsistabs24269.html

SYS.SYSTABLES table has all database tables

On 23.6.2007, at 19:20, amadis wrote:

> Hi, derby-user
>
>    i created a table in derby, but i forgot the name of the table,  
> is there any sql that can show all the names out?
>
>
> amadis
> 2007-06-24


Re: Re: how to select all table names of some database in derby?

Posted by amadis <pe...@gmail.com>.
Hi, Derby Discussion    

ok, problem solved.
thanks, jean & Peter Ondruska.

solution 1:
select * from SYS.SYSTABLES;   -- this will show all the tables of database. Sorry Peter, i was wrong at the first time.

solution 2:
select s.schemaname || '.' || t.tablename  
     from sys.systables t, sys.sysschemas s  
     where t.schemaid = s.schemaid 
          and t.tabletype = 'T' 
     order by s.schemaname, t.tablename;   -- this will show all the tables created by users.

solution 3:
The 10.2 release adds 'show tables' and 'describe' commands to ij.

amadis    
2007-06-24      
----- Original Message -----      
From:   Jean T. Anderson      
To:   Derby Discussion      
Sent:  2007-06-24, 02:11:45     
Subject:  Re: how to select all table names of some database in derby?     



     
>On Sun, 24 Jun 2007 01:20:24 +0800, "amadis"  said: 
>> Hi, derby-user  
>>     
>>    i created a table in derby, but i forgot the name of the table, is 
>>    there any sql that can show all the names out? 
> 
>This wiki page has a sql query that might help: 
>   http://wiki.apache.org/db-derby/ListTableNames 
> 
>It also mentions the ij 'show tables' command that was introduced with 
>10.2. 
>  
>-jean 
> 
>p.s. That wiki page is linked from this general hints&tips page: 
>http://wiki.apache.org/db-derby/HintsAndTips 

Re: how to select all table names of some database in derby?

Posted by "Jean T. Anderson" <jt...@bristowhill.com>.
On Sun, 24 Jun 2007 01:20:24 +0800, "amadis" <pe...@gmail.com> said:
> Hi, derby-user 
>    
>    i created a table in derby, but i forgot the name of the table, is
>    there any sql that can show all the names out?

This wiki page has a sql query that might help:
   http://wiki.apache.org/db-derby/ListTableNames

It also mentions the ij 'show tables' command that was introduced with
10.2.
 
-jean

p.s. That wiki page is linked from this general hints&tips page:
http://wiki.apache.org/db-derby/HintsAndTips