S smale Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-01 #1 请问何为主从表? 主从表和普通表相比有什么特点? 应该怎样建立一个主从表?
D dansl Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-01 #5 create table tablename{从表名} ( ES_YEAR VARCHAR2(4) not null, ES_UNIT VARCHAR2(40) not null, ES_TYPE VARCHAR2(10) not null, ES_NAME VARCHAR2(20), constraint pkname{主键名} primary key (ES_YEAR, ES_UNIT, ES_TYPE) //注意下段 references ptablename{主表名}(ES_YEAR, ES_UNIT, ES_TYPE, ES_SIGN ) ) /
create table tablename{从表名} ( ES_YEAR VARCHAR2(4) not null, ES_UNIT VARCHAR2(40) not null, ES_TYPE VARCHAR2(10) not null, ES_NAME VARCHAR2(20), constraint pkname{主键名} primary key (ES_YEAR, ES_UNIT, ES_TYPE) //注意下段 references ptablename{主表名}(ES_YEAR, ES_UNIT, ES_TYPE, ES_SIGN ) ) /
Y yisan Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-01 #6 简单地说,两个table构件:mainTable,DetailTable,两个数据源构件dsMain,dsDetail 两个表main,Detail,结构如下: main id name sex 1 aaa f 2 bbb m detail id name grade 001 english 80 002 maths 90 设置如下: mainTable.datasouce:=dsMain mainTable.tablename:=main detailTable.datasource:=dsDetail detailTable.talbe:=detail detailTable.MasterSource:=dsMain detailTable.masterField:=mainTable.XXX 这就OK了
简单地说,两个table构件:mainTable,DetailTable,两个数据源构件dsMain,dsDetail 两个表main,Detail,结构如下: main id name sex 1 aaa f 2 bbb m detail id name grade 001 english 80 002 maths 90 设置如下: mainTable.datasouce:=dsMain mainTable.tablename:=main detailTable.datasource:=dsDetail detailTable.talbe:=detail detailTable.MasterSource:=dsMain detailTable.masterField:=mainTable.XXX 这就OK了