db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Cecchet <m...@frogthinker.org>
Subject Re: how to show all tables in current schema without using ij tool?
Date Thu, 06 Jan 2011 12:34:47 GMT
Hi,
> I am struggling with issues when it comes to Apache derby:
> 1-  I haven't been able to get a list of Tables in a schema without 
> using ij. Is this feasible?
SELECT * FROM SYS.SYSTABLES
> 2- I haven't been able to use "On Delete Cascade", any good examples 
> are appreciated.
CREATE TABLE a (pk INT NOT NULL CONSTRAINT a_pk PRIMARY KEY)
CREATE TABLE b (x LONG VARCHAR, id INT CONSTRAINT b_fk REFERENCES a(pk) 
ON DELETE CASCADE)
INSERT INTO a VALUES (1)
INSERT INTO b VALUES ('hello', 1)
SELECT * FROM a,b
PK 	X 	ID
1 	hello 	1

DELETE FROM b
SELECT * FROM a,b
PK 	X 	ID



Hope this helps,
Emmanuel

-- 
Emmanuel Cecchet
FTO @ Frog Thinker
Open Source Development&  Consulting
--
Web: http://www.frogthinker.org
email: manu@frogthinker.org
Skype: emmanuel_cecchet


Mime
View raw message