Perf07

- Main Page
- Data Structures
- Files

Perf07

Author:
  Jeffrey R. Parsons, Raima Sr. Engineer

Date:
  2012

# Description

EXAMPLE - Perf07

The Perf07 example creates and reads a Bill-of-Materials using network model sets.

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 perf07_db.ddl. The example utilizes the RDM Core DDL syntax and specifies a database suitable for storing a Bill-of-Materials.

/*
* Raima Database Manager
*
* Copyright (c) 2012 Raima Inc., All rights reserved.
*
* EXAMPLE - perf07
*
* This is the DDL (SQL Database Definition Language) for a simple Bill of
* Materials database. This version uses set relationships instead of
* indexing.
*/
database perf07_db {
data file "perf07.d01" contains item;
data file "perf07.d02" contains bill;
key file "perf07.k01" contains id_code;
record item {
unique key char id_code[16];
char description[58];
double cost;
}
record bill {
double quantity;
int32_t level;
}
set bom {
order last;
owner item;
member bill;
}
set where_used {
order last;
owner item;
member bill;
}
}

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 perf07_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_errorname
- d_errorstr
- d_opentask/d_closetask
- d_open_ptr/d_close
- d_initialize
- d_csoget
- d_csmget
- d_setor
- d_fillnew
- d_connect
- d_setro
- d_csoset
- d_csmset
- d_members
- d_recread
- d_findnm
- d_findco
- d_recfrst

They are fully documented in http://docs.raima.com/rdm/.