Question

I'm working on a JavaEE project, with DB2 Database and JPA. Can we make Inheritance between tables ? In the IBM DB2 Website, i found nothing on the DB2 documentation to do this via SQL code.

This is what i want to do Exemple :

CREATE TABLE TRANSACTION (
TranNo int);

CREATE TABLE MOBILETRANSACTION (
Number1 varchar(255),
Number2 varchar(255) );

What is the word to add to the MOBILETRANSACTION Table to inherit the TRANSACTION table ?

Thank you !

Was it helpful?

Solution

What you need is called typed-tables in DB2. For global information about inheritance: http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.admin.structypes.doc/doc/c0006588.html

You first need to create a structure (type), and then you can use that structure in a table.

Please, check this first (http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.admin.structypes.doc/doc/c0006441.html) read all sections and them proceed with your own implementation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top