-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRpsImport.bat
28 lines (28 loc) · 970 Bytes
/
RpsImport.bat
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
@echo off
rem Make sure we have a schema
echo Locating schema file...
if not exist %ROOT%RPS\REPLICATION.SCH goto no_schema
rem Test to see if the schema will load
echo Testing schema load...
dbs RPS:rpsutl -i %ROOT%RPS\REPLICATION.SCH -ia -ir -s -n %ROOT%RPS\rpsmain.new %ROOT%RPS\rpstext.new
if "%ERRORLEVEL%"=="1" goto parse_fail
if exist %ROOT%RPS\rpsmain.new del /q %ROOT%RPS\rpsmain.new
if exist %ROOT%RPS\rpsmain.ne1 del /q %ROOT%RPS\rpsmain.ne1
if exist %ROOT%RPS\rpstext.new del /q %ROOT%RPS\rpstext.new
if exist %ROOT%RPS\rpstext.ne1 del /q %ROOT%RPS\rpstext.ne1
echo Test OK
rem Load the schema
echo Performing schema load...
dbs RPS:rpsutl -i %ROOT%RPS\REPLICATION.SCH -ia -ir
if "%ERRORLEVEL%"=="1" goto load_fail
echo Schema loaded OK
goto done
:no_schema
echo *ERROR* Schema file not found!
goto done
:parse_fail
echo *ERROR* Schema parse failed - repository not changed
goto done
:load_fail
echo *ERROR* Schema load failed - repository not changed
:done