- Author:
- Jeffrey R. Parsons, Raima Sr. Engineer
- Date:
- 2012
Description
EXAMPLE - Perf08
The Perf08 example creates and reads a Bill-of-Materials using relational index definitions.
Each time you run this example
- The database is initialized (removing all existing data)
- A new Bill-of-Materials is created
- The Bill-of-Materials is read
- Database is cleaned up
Database
The DDL (Database Definition Language) specification for the database used in this example is located in the file perf08_db.ddl. The example utilizes the RDM Core DDL syntax and specifies a database suitable for storing a Bill-of-Materials.
database perf08_db {
data file "perf08_db.d01" contains ritem;
data file "perf08_db.d02" contains rbill;
key file "perf08_db.k01" contains rid_code;
key file "perf08_db.k02" contains rbom;
record ritem {
unique key char rid_code[16];
char rdescription[58];
double rcost;
int32_t rcomponent_count;
}
record rbill {
char rparent[16];
char rcomponent[16];
int32_t rsequence;
double rquantity;
int32_t rlevel;
compound key rbom {
rparent;
rsequence;
}
}
}
The schema was compiled using the RDM ddlp utility with the -c option to generate an embedded database dictionary (used by the RDM d_open_ptr API).
ddlp -c -d perf08_db_db.ddl
The database dictionary information is embedded inside the application so an external DBD file stored on the file system is not required.
Functions Used
The following RDM functions are illustrated:
- d_tfsinitEx/d_tfsterm
- d_opentask/d_closetask
- d_open_ptr/d_close
- d_initialize
- d_keyszstate
- d_fillnew
- d_keyrdstate/d_keywrstate
- d_keyfind
- d_recread
- d_keyfrst
- d_crread
- d_keynext
They are fully documented in http://docs.raima.com/rdm/.