-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSUTRANSCO.SQLRPGLE
64 lines (45 loc) · 1.42 KB
/
SUTRANSCO.SQLRPGLE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
**free
ctl-opt nomain;
/copy RPGUNIT/RPGUNIT1,TESTCASE
dcl-s wCommande char(512);
dcl-s wrc int(10);
// définition des prototypes
dcl-pr setUp;
end-pr;
dcl-pr execcmd int(10) extproc('system');
cmdstring pointer value options(*string);
end-pr;
//---------------------------------------------------------------//
// Procédure de mise en place des tests, appelée en entrée
// elle permet d'initialiser l'environnement (bdd) pour avoir
// des jeux de test toujours identiques et propres
dcl-proc setUp export;
dcl-pi *n;
end-pi;
exec sql
create collection transcotu;
// message erreur collection
Assert(SqlCode = 0
:'Erreur création collection transcotu : SqlCode = ' + %Char(SqlCode));
// creation table TRANSCOTU/transcof
exec sql
create table transcotu/transcof (
code_entree char(20),
code_sortie dec(5)
);
// message erreur table
Assert(SqlCode = 0
:'Erreur creation table transcotu/transcof ' + %Char(SqlCode));
AddLibLe();
end-proc;
//--------------------------------------------------------------------
// Procédure début: AddLibLe
//------------------------------------------------------------------
Dcl-Proc AddLibLe;
Dcl-S rc Int(10);
wCommande = 'AddLibLe Lib(transcotu)';
// Execution commande
rc = ExecCmd(%Trim(wCommande));
Assert(rc = 0
:'Une erreur est survenue lors du AddLibLe de transcotu');
End-Proc;