SQL/MX 2.x Database and Application Migration Guide (G06.23+, H06.04+, J06.03+)
Converting an SQL/MP Database to SQL/MX Tables
HP NonStop SQL/MX Database and Application Migration Guide—540435-005
11-24
Using DataLoader/MX to Copy Data
Steps for Using DataLoader/MX
To use DataLoader/MX to load data from an SQL/MP table into an SQL/MX table:
1. Create a customized DataLoader executable.
The customized DataLoader executable converts data from the format provided by
the SQLCI COPY command into the format required by the
import utility.
2. Start a copy of the customized DataLoader executable, which reads input from
$RECEIVE and writes output to $RECEIVE.
3. Run the SQLCI COPY command, reading data from the SQL/MP table and writing
it to the DataLoader process.
4. Run
import, reading data from the DataLoader process and writing it to the
SQL/MX table.
Example of Using DataLoader/MX
This example shows how DataLoader/MX loads data from an SQL/MP table,
$data01.test.tab1, into an SQL/MX table, cat.sch.tab1. The column definitions for both
tables in this example are:
(
C1 INT DEFAULT NULL
, C2 FLOAT(54) DEFAULT NULL
, C3 CHAR(5) DEFAULT NULL
)
In a real loading situation, you would need to add checks in the customized user exit
routine to handle null values and error conditions.
1. To create a customized DataLoader executable, use a modified copy of either the
C or COBOL stubs files (
sexitsc.c or sexitscb.cob).
a. If the exit routine is written in the C programming language, as it is in this
example, create a copy of the
sexitsc.c file and change the code in the
CONVERTIT procedure. For the SQL/MP table in this example, create a file,
myexits.c, which contains this code:
#include "dtload.h" nolist
#include <stdio.h> nolist
#include <stdlib.h> nolist
#include <string.h> nolist
DTLEXP
void WINAPI CONVERTIT(
char* RecIn,
long* RecInLen,
char* RecOut,
long* RecOutLenMax,
Note. To speed up the loading process, start multiple DataLoader processes.










