Subject | Re: [firebird-support] Automation tools? |
---|---|
Author | Slavomir Skopalik |
Post date | 2017-08-15T13:46:31Z |
Hi,
we are using combination of bat and SQL.
In bat file we are generating SQL and vice versa.
Some example:
@SET sql=s1.sql
@ECHO SET TERM ^^; >%sql%
@ECHO EXECUTE BLOCK AS>>%sql%
@ECHO DECLARE VARIABLE s VARCHAR(1000);>>%sql%
@ECHO BEGIN>>%sql%
@ECHO s = 'CREATE USER %3 PASSWORD ''%4'';';>>%sql%
@ECHO BEGIN>>%sql%
@ECHO EXECUTE STATEMENT s WITH AUTONOMOUS
TRANSACTION;>>%sql%
@ECHO WHEN ANY DO BEGIN END>>%sql%
@ECHO END >>%sql%
@ECHO END^^ >>%sql%
@ECHO SET TERM ;^^ >>%sql%
@ECHO GRANT RDB$ADMIN TO %3;>>%sql%
@ECHO SET ECHO OFF; >>%sql%
@ECHO SET HEADING OFF; >>%sql%
@ECHO output RepInfo.bat; >>%sql%
@ECHO SELECT '@SET DBNO='^|^|(MAX(DBNO) + 1) FROM
REPL$DATABASES;>>%sql%
@ECHO SELECT '@SET SchNo='^|^|(MAX(ReplNo) + 1) FROM
REPL$Schemata;>>%sql%
%ISQL% -b -e -q -charset UTF8 -i %sql% %1
@IF %ERRORLEVEL% NEQ 0 goto :error
Slavek
Ing. Slavomir Skopalik Executive Head Elekt Labs s.r.o. Collection and evaluation of data from machines and laboratories by means of system MASA (http://www.elektlabs.cz/m2demo) ----------------------------------------------------------------- Address: Elekt Labs s.r.o. Chaloupky 158 783 72 Velky Tynec Czech Republic --------------------------------------------------------------- Mobile: +420 724 207 851 icq:199 118 333 skype:skopaliks e-mail:skopalik@elektlabs.cz http://www.elektlabs.cz
Hi,
We're in need of a tool where we can author sequences of SQL queries against FB and non-DB commands like file operations etc. I'd like to call them "batch runs" to perform recurring tasks.
Do you know of such tools or what that kind of tool would be called in general?
We need to be able to schedule some runs. Others need to be triggered by e.g. the appearance of a file in a local or FTP/SFTP folder. Yet others need to be executed ad hoc, i.e. started manually.
We also need to be able to enter conditions/checks between each step, to check results, e.g. reasonable number of affected records, and bail out or at least send a warning e-mail message to me if something goes wrong or looks suspicious.
Regards,
Kjell
--
Kjell Rilbe
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
Marknadsinformation i Sverige AB
Ulvsundavägen 106C
168 67 Bromma
www.marknadsinformation.se
08-514 905 90