Ga naar inhoud

Table InventoryDetail

A conversion from the old INVENTORYDET table.

DDL

create sequence seqInventoryDetail as bigint start with 1;

create table InventoryDetail (
   ivdID pointer not null default next value for seqInventoryDetail,
   ivdCreatedOn datetime not null default sysdatetime(),
   ivdCreatedByFK bigint not null,
   ivdChangedOn datetime not null default sysdatetime(),
   ivdChangedByFK bigint not NULL,
   ivdInventoryFK bigint not null default 0,
   ivdArticleFK bigint not null default 0,
   ivdLocationFK bigint not null default 0,
   ivdStockCode Name not null default '',
   ivdQuantity int not null default 0,
   ivdComments Name not null default '',
   ivdCustomerFK bigint not null default 0,
   CONSTRAINT pkInventoryDetail PRIMARY KEY (ivdID)
);

alter table InventoryDetail add constraint fkInventoryDetailInventory foreign key (ivdInventoryFK) references Inventory(ivID) on update cascade on delete cascade;
alter table InventoryDetail add constraint fkInventoryDetailArticle foreign key (ivdArticleFK) references Article(aID) on update cascade on delete cascade;
alter table InventoryDetail add constraint fkInventoryDetailLocation foreign key (ivdLocationFK) references Location(lID) on update cascade on delete cascade;
alter table InventoryDetail add constraint fkInventoryDetailCustomer foreign key (ivdCustomerFK) references Customer(cID) on update cascade on delete cascade;

Default Data

none

Mapping

INVENTORYDET

Conversion ID:

New Old
ivdID ID (now newly generated)
ivdCreatedOn CRDATE + CRTIME
ivdCreatedByFK MYOPERATOR
ivdChangedOn
ivdChangedByFK
ivdInventoryFK IDNO
ivdArticleFK ARTCODE
ivdLocationFK LOCATION
ivdStockCode STOCKCODE
ivdQuantity QTY
ivdComments COMMENTS
ivdCustomerFK SUPPLIER
already defined in Inventory table TRANSACTIONTYPE