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:skopa...@elektlabs.cz
http://www.elektlabs.cz

On 15.8.2017 15:36, Kjell Rilbe kjell.ri...@marknadsinformation.se [firebird-support] wrote:

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

--

Marknadsinformation logotyp

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 <http://www.marknadsinformation.se>
08-514 905 90

Företagskontakt.se <http://xn--fretagskontakt-vpb.se>
Personkontakt.se <http://personkontakt.se>




  • [firebir... Kjell Rilbe kjell.ri...@marknadsinformation.se [firebird-support]
    • Re:... Slavomir Skopalik skopa...@elektlabs.cz [firebird-support]
    • Re:... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
      • ... Kjell Rilbe kjell.ri...@marknadsinformation.se [firebird-support]
    • Re:... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
      • ... Kjell Rilbe kjell.ri...@marknadsinformation.se [firebird-support]
    • RE:... 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
    • RE:... Edward Mendez edmende...@gmail.com [firebird-support]

Reply via email to