Bonjour je souhaite intégrer mon sql loader en KSH .
j'ai réussi en .bat mais KSH je sèche...
voilà ce que j'ai fait en .bat
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149 REM -- Connection Oracle (user/pass@connection) REM -- ---------------------------------------- SET CONNECT_STRING=%1 REM -- REM -- Fichier à traiter (chemin complet) REM -- ---------------------------------- SET INFILE=%~2 REM -- REM -- Répertoire de l'exécutable sql*loader REM -- ------------------------------------- SET CHEMIN_SQLOADER=%~3 REM -- REM -- Répertoire racine du traitement ( ./LOG ; ./SCRIPT ; ./SQL ) REM -- ------------------------------------------------------------ SET DIR_TRT=%~4 REM -- REM -- Fichier de controle REM -- ------------------- SET CONTROL_FILE=%DIR_TRT%\SCRIPT\FL0852_OSS310.ctl REM -- REM -- Fichier log sql*loader REM -- ---------------------- SET LOG_FILE=%DIR_TRT%\LOG\OSS310.LOG REM -- REM -- Fichier bad sql*loader REM -- ---------------------- SET BAD_FILE=%DIR_TRT%\LOG\OSS310.BAD REM -- REM -- Fichier discard sql*loader REM -- -------------------------- SET DSC_FILE=%DIR_TRT%\LOG\OSS310.DSC REM -- REM -- Chemin des scripts SQL REM -- ---------------------- REM SET SQL_DIR=%DIR_TRT%\SQL SET TRT_OSS310_852=TRT_OSS310_852 REM REM -------------------------------------------------------------------------------------- REM -------------------------------------------------------------------------------------- REM TEST DES PARAMETRES D'ENTREE REM -------------------------------------------------------------------------------------- if '%1'=='' echo Usage 1: INTERFACE_PXL_060 connectString dataFile repLoader repTrt & exit -100 if '%2'=='' echo Usage 2: INTERFACE_PXL_060 connectString dataFile repLoader repTrt & exit -101 if '%3'=='' echo Usage 3: INTERFACE_PXL_060 connectString dataFile repLoader repTrt & exit -102 if '%4'=='' echo Usage 4: INTERFACE_PXL_060 connectString dataFile repLoader repTrt & exit -103 REM REM -------------------------------------------------------------------------------------- REM -------------------------------------------------------------------------------------- REM Supression des fichiers intermédiaires REM -------------------------------------------------------------------------------------- if exist %DSC_FILE% DEL %DSC_FILE% if exist %LOG_FILE% DEL %LOG_FILE% IF exist %BAD_FILE% DEL %BAD_FILE% IF exist %DIR_TRT%\LOG\ERROR.TXT DEL %DIR_TRT%\LOG\ERROR.TXT IF exist %DIR_TRT%\LOG\%DELTA_SQL_FILE%.log del %DIR_TRT%\LOG\%DELTA_SQL_FILE%.log IF exist %DIR_TRT%\LOG\%INTEGRATION_SQL_EXECUTE%.log del %DIR_TRT%\LOG\%INTEGRATION_SQL_EXECUTE%.log REM REM -------------------------------------------------------------------------------------- REM -------------------------------------------------------------------------------------- REM CONTROLE DU FICHIER DE DONNEES REM -------------------------------------------------------------------------------------- REM ---------------------------------------------------- s: chdir %DIR_TRT%\SCRIPT rem ECHO %DIR_TRT%\..\BIN\ControlePXL.EXE userid=%CONNECT_STRING% -f %INFILE% -l %DIR_TRT%\LOG\Controle.log >.\SCRIPT\param.txt rem CALL %DIR_TRT%\..\BIN\ControlePXL.EXE userid=%CONNECT_STRING% -f %INFILE% -l %DIR_TRT%\LOG\Controle.log if errorlevel 20 echo Erreur 0 : Echec lors de l'ouverture du fichier de donnee %INFILE% >>%DIR_TRT%\LOG\error.txt & exit -1 if errorlevel 10 echo Erreur 1 : Fichier %INFILE% invalide : Nb d'enregistrements incorrect !>>%DIR_TRT%\LOG\error.txt & exit -2 if errorlevel 5 echo Erreur 2 : Arguments absents lors de l'appel ! >>%DIR_TRT%\LOG\error.txt & exit -3 REM REM -------------------------------------------------------------------------------------- REM -------------------------------------------------------------------------------------- REM Lancement de SQLOADER REM -------------------------------------------------------------------------------------- REM -------------------------------------------------------------------------------------- echo userid=%CONNECT_STRING% > param.par echo control="%CONTROL_FILE%" >> param.par echo log="%LOG_FILE%" >> param.par echo bad="%BAD_FILE%" >> param.par echo data="%INFILE%" >> param.par echo discard="%DSC_FILE%" >> param.par echo errors="100" >> param.par REM -------------------------------------------------------------------------------------- REM -------------------------------------------------------------------------------------- echo %DIR_TRT% CALL SQLLDR.EXE PARFILE=%DIR_TRT%\SCRIPT\param.par REM -------------------------------------------------------------------------------------- REM -------------------------------------------------------------------------------------- if exist %BAD_FILE% echo Erreur 2 : Présence d'enregistrements invalides. >> %DIR_TRT%\LOG\error.txt & exit -4 CALL sqlplus %CONNECT_STRING% @"..\SQL\%TRT_OSS310_852%.sql" if errorlevel 20 echo Warning 1 : La mise à jour de certains matricules a échoué. >>%DIR_TRT%\LOG\error.txt & exit 1 if errorlevel 10 echo Erreur 4 : Echec du script de Mise à jour automatique des variables de paie >>%DIR_TRT%\LOG\error.txt & exit -6 :fin exit 0
Partager