SQL/MX Programming Manual for C and COBOL (H06.10+, J06.03+)

C/C++ Program Compilation
HP NonStop SQL/MX Programming Manual for C and COBOL544617-003
15-55
Deploying a Static SQL Application to an RDF
System
1. Suppose that the RDF primary system is \APPLE. On \APPLE, suppose that you
want all your user modules to use the schema ‘telco.modules’.
2. Suppose that the RDF backup system is \indus. On \indus, suppose that you are
constrained by SQL/MX Release 2.x RDF rules to use the schema ‘comms.mods’.
3. On the development system \robin, create a development (possibly, zero-row or
empty) copy of your application’s SQL/MP tables (and their statistics) from the RDF
primary system \APPLE. You need not make local copies of the backup system’s
corresponding tables because they will always be similar to the primary system’s
tables.
4. On the development system \robin, create static SQL C/C++ source files (for
example, nonstop1.sql and nonstop2.sql):
// nonstop1.sql
EXEC SQL MODULE nonstop1mod;
int main() { ...
EXEC SQL INVOKE =debits AS debits_type;
EXEC SQL UPDATE =debits SET balance = balance + ?;
...
}
// nonstop2.sql
EXEC SQL MODULE nonstop2mod;
int pay() { ...
EXEC SQL INVOKE =credits AS credits_type;
EXEC SQL UPDATE =credits SET balance = balance + ?;
...
}
OSS
directory for
backup
/usr/backup /usr/beta
=debits
DEFINE for
primary
$data07.ccards.debits $plat.charges.buys
=debits
DEFINE for
backup
$data07.ccards.debits $gold.cards.debits
=credits
DEFINE for
primary
$data17.ccards.credits $plat.charges.pays
=credits
DEFINE for
backup
$data17.ccards.credits $gold.cards.credit
Table 15-2. Module Schemas and Export Files for RDF SQL Application
Deployment Example (page2of2)
Development RDF Primary RDF Backup