echo run at WORK
if x%2==x goto usage
@SET DBVER=%1
@SET BUILD=%2

SET targetUSER=TEST_DB%1
SET targetPASS=TEST_DB%1
SET targetSERVER=WORK

SET logger=%targetSERVER%_%targetUSER%_%~n1.log


set oracle_sid=%targetSERVER%
@TITLE Creating %targetUSER%@%targetSERVER%
@ECHO Creating %targetUSER%@%targetSERVER%
sqlplus.exe system/XZSTXnHGjfNNODfQc@%targetSERVER% @.\CreateUser%targetSERVER%.sql %targetUSER% %targetPASS%
@if errorlevel 1 goto nocreate

@TITLE Running FCLT%DBVER%.sql
ECHO @%BUILD%\DB%DBVER%\FCLT%DBVER%.sql >xtmp.sql
ECHO UPDATE fac_version SET fac_version_cust = 'CREA'; >>xtmp.sql
ECHO @@z:\Project\FACILITOR\Database\trunk\_UTIL\SUPPORT_IDP\supportJWT_SAAS.sql>>xtmp.sql
ECHO EXIT >>xtmp.sql
sqlplus.exe %targetUSER%/%targetPASS%@%targetSERVER% @xtmp.sql | FINDSTR /C:"BEGIN adm.sys" /C:"ORA-" /C:"SP2-" /C:"Waarschuwing: package-body is aangemaakt met compilatiefouten."
DEL xtmp.sql
goto end

:usage
echo gebruik: %0 28 path/to/build
echo Test het crea script
pause
goto end

:nocreate
@echo ===============================================================================
@echo Het is niet gelukt gebruiker %targetUSER%@%targetSERVER% goed aan te maken
pause
goto end

:end
