hi
I am trying to create the database using a BAT file but the script is not recognizing the username and password sent as parameters and gives error.
The BAT looks like following -
and called as c:\ testit.bat db2admin S0meP@ss123
----------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------
@Echo Off
set dbuser = %1
set pwd = %2
db2cmd /c /w /i db2 ATTACH TO DB2 USER %dbuser% USING %pwd%
if not %errorlevel% == 0 goto error
db2cmd /c /w /i db2 CREATE DATABASE SAMPLE2
if not %errorlevel% == 0 goto error
Echo " CREATE DB IS DONE..."
:error
echo "Error" >> commands.log
exit
:end
echo "OK" >> commands.log
exit
----------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------