Informix DB-Access Usage Enhancer for Windows-2000.
This batch (script) file will help you to run SQL commands from the windows command prompt.
Salient Features of this Run utility are:
. Simple script file; easy to use at prompt level.
. Searches DML statements and traps it under transaction.
. Prompts for commit or rollback transaction.
. Traps delete statement with missing where clause.
. Writes all the committed statements in a flat dump file.
Listing of R.CMD
@echo off
rem IBM Informix DB-Access Usage Enhancer for Windows-2000.
rem V.P. Shriyan 10/10/2002.
rem Script has been tested for vers. 7.31, 9.2 and 9.3
rem This script assumes that the following environment
rem are set with valid paths / values.
rem
rem INFORMIXDIR INFORMIXSERVER ONCONFIG
rem
rem INFORMIXSQLHOSTS CLIENT_LOCALE DB_LOCALE
rem SERVER_LOCALE DBLANG
rem change these two parameters as required
set DB=testdb
set LOG=%TEMP%\%DB%.log
set WINROOT=%SystemRoot%
if "x%WINROOT%" == "x" SET WINROOT=C:\WINNT
set GREP=%WINROOT%\System32\findstr.exe
set DBACCESS=%INFORMIXDIR%\bin\dbaccess.exe
set CMD=%*
set CMD1=%CMD%
ver
if "x%INFORMIXDIR%" == "x" ( echo INFORMIXDIR need to be set.
goto :end )
if not exist %DBACCESS% ( echo %DBACCESS% is required.
goto :end )
if not exist %GREP% ( echo %GREP% is required.
goto :end )
echo \%1 | %GREP% /I "? \/? -- help -help" > nul
if %ERRORLEVEL% == 0 ( goto :help )
if "x%CMD%" == "x" ( echo Pass SQL statement to execute.
goto :end )
%INFORMIXDIR%\bin\onstat - | %GREP% " not " > nul
if %ERRORLEVEL%==0 (echo Database server %INFORMIXSERVER% not up
goto :end )
:ckwhere
echo %CMD%|%GREP% /I "where" >nul
if %ERRORLEVEL% == 1 ( echo.
echo Warning:
echo WHERE clause is missing. Please be careful.
echo If you are sure what you are doing invoke as
echo %*% where 1=1
goto :end )
:help
echo.
echo IBM Informix DB-Access Usage Enhancer.
echo by V.P. Shriyan 10/10/2002.
echo.
echo Salient Features:
echo.
echo . Simple script file; easy to use at prompt level.
echo . Searches DML statements and traps it under transaction.
echo . Prompts for commit or rollback transaction.
echo . Traps delete statement with missing where clause.
echo . Writes all the committed statements in a flat dump file.
:end
set DB=
set WINROOT=
set GREP=
set DBACCESS=
set CMD=
set CMD1=
set LOG=
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.