Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 67496 invoked from network); 16 Dec 2005 18:59:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Dec 2005 18:59:18 -0000 Received: (qmail 57236 invoked by uid 500); 16 Dec 2005 18:59:01 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 57196 invoked by uid 500); 16 Dec 2005 18:59:01 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 57183 invoked by uid 99); 16 Dec 2005 18:59:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Dec 2005 10:59:01 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [32.97.182.143] (HELO e3.ny.us.ibm.com) (32.97.182.143) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Dec 2005 10:58:59 -0800 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e3.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id jBGIwate020153 for ; Fri, 16 Dec 2005 13:58:36 -0500 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay02.pok.ibm.com (8.12.10/NCO/VERS6.8) with ESMTP id jBGIwbb1118112 for ; Fri, 16 Dec 2005 13:58:37 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11/8.13.3) with ESMTP id jBGIwaFD003363 for ; Fri, 16 Dec 2005 13:58:36 -0500 Received: from [127.0.0.1] (sig-9-48-109-15.mts.ibm.com [9.48.109.15]) by d01av01.pok.ibm.com (8.12.11/8.12.11) with ESMTP id jBGIwZiG003255 for ; Fri, 16 Dec 2005 13:58:36 -0500 Message-ID: <43A30DF8.1020608@Sourcery.Org> Date: Fri, 16 Dec 2005 10:56:56 -0800 From: Satheesh Bandaram User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Development Subject: Re: derby user (Forwarding to DerbyDev) References: <20051216131129.88383.qmail@web8411.mail.in.yahoo.com> <43A30B22.9020603@bristowhill.com> In-Reply-To: <43A30B22.9020603@bristowhill.com> X-Enigmail-Version: 0.85.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N We keep seeing many requests for this kind of behavior... It should be pretty easy to enhance IJ to add DESCRIBE like functionality. This would be a good project for anyone interested in learning Derby system tables and some JDBC programming, so I am forwarding this to DerbyDev. We do have a Jira entry for this new feature already: http://issues.apache.org/jira/browse/DERBY-457 Satheesh Jean T. Anderson wrote: > meenakshi selvi wrote: > >> hi >> >> 1.is there any way to describe the table in ij tools. > > > You can execute SQL select statements that query the system tables. > The system tables are listed here > > http://db.apache.org/derby/docs/dev/ref/rrefsistabs38369.html > > Obtaining the description for a table is pretty simple if you just > want the column names and types; for example, given this table: > > ij> create table hotelavailability > (hotel_id int not null, > booking_date date not null, > rooms_taken int default 0, > primary key (hotel_id, booking_date) > ); > > This query gets you the information in the sys.systables table: > > select * from sys.systables where tablename = 'HOTELAVAILABILITY'; > > This query gets the columns for that table: > > ij> select c.columnnumber, > c.columnname, > c.columndatatype > from sys.syscolumns c, sys.systables t > where c.referenceid=t.tableid > and t.tablename='HOTELAVAILABILITY' > order by 1; > > COLUMNNUMB&|COLUMNNAME |COLUMNDATATYPE > ----------------------------------------------------- > 1 |HOTEL_ID |INTEGER NOT NULL > 2 |BOOKING_DATE |DATE NOT NULL > 3 |ROOMS_TAKEN |INTEGER > > 3 rows selected > > > Add a join to sys.syscontraints to get constraint information -- > here's where the query can start getting really messy. dblook might > be an easier option; see the next point. > >> 2.is there any way to show the tables in a database. > > > dblook dumps the schema for a database or table; for more information, > see > > http://db.apache.org/derby/docs/dev/tools/ctoolsdblook.html > > regards, > > -jean > > >