When in-memory temporary tables are created, the table and rows are in memory. R:BASE initially allocates 32,000 bytes for each in-memory table, whereas the table grows, the space will increase as needed. R:BASE currently limits a database to one thousand (1000) in-memory tables. If indexes and keys are built for an in-memory table, the key data is written to the temporary files.
Use the CREATE TABLE command to create an in-memory temporary table. Use the CREATE VIEW command to create an in-memory temporary view. The INTERSECT, JOIN, PROJECT, SUBTRACT, and UNION commands can also be used to create an in-memory temporary table.
The following command creates an in-memory temporary table that would contain task records:
CREATE INMEMORY TABLE iTasks +
(ID INTEGER NOT NULL +
('Value for column ID cannot be null'), +
TaskCaption TEXT (80), +
TaskStart DATETIME, +
TaskFinish DATETIME, +
EventType INTEGER, +
TaskOptions INTEGER, +
TaskIndex INTEGER, +
TaskComplete INTEGER, +
TaskLink TEXT (80), +
CostID INTEGER, +
JobNo TEXT (13), +
GroupID INTEGER)
The following defines an in-memory view of customers and contacts linked by CustID:
CREATE INMEMORY VIEW iCustomerContact +
(CustID,Company,ContID,ContFName,ContLName, +
ContPhone,ContEMail,LastContactDate) AS +
SELECT T1.CustID,T1.Company,T2.ContID,T2.ContFName,T2.ContLName, +
T2.ContPhone,T2.ContEMail,T2.LastContactDate +
FROM Customer T1,Contact T2 +
WHERE T1.CustID = T2.CustID