Menu

Help

Barış Kayar

BKFSQLBATCH

You can use it to connect a DB (mssql, mysql ...etc) and get a query (select statement or stored procedure). It will get results and send every fields of rows that you defined to a batch file as parameters.

Sample Ini File
[BKF]
;ProcPath : you should define work directory as procpath
ProcPath=C:\BKFSQLBatch\Win64\test
;ProcParams: you should define all parameters as procparams seperated by space character.
; the parameter format should be : opt1:opt2:opt3
ProcParams=prodid:SQL:string prodname:SQL:string prodprice:SQL:string prodimage:SQL:string prodimage:Func:ExtractPath prodimage:Func:ExtractFileName tempdir:SQL:string
;1st Param : prodid:SQL:string : prodid value will return from query and send as first parameter to mysqlprocess.bat.
;5th Param : prodimage:Func:ExtractPath: prodimage value will return from query and execute with ExtractFileName function and send as fifth parameter to mysqlprocess.bat
;LogPath: you should define log directory, it should under procpath, if doesn't exists it will be create automatically.
LogPath=log
;WaitTime: you should set wait time between two process. it will pause as WaitTime after every execute batch file.
WaitTime=5000
;Repeat: you should set to 0 this parameter if you want to terminate application after task completed
Repeat=0
;if Repeat is 1 then program will not terminate, it will wait for Interval(millisecond) and process again.
Interval=1800000
[SQL]
ConnStr=Provider=MSDASQL.1;Persist Security Info=False;Data Source=mycon
User=root
Pass=bart544
;LineN: you can set SQL statement
;Line1= select 'x.bat' as BatchFile,
;Line2= * from
;Line3= productions
;Line5= bla bla bla ; this line will ignore because there is no Line4
Line1= select 'mysqlprocess.bat' as BatchFile,p.*,'temp' as Tempdir from productions p

Sample Batch File {mysqlprocess.bat}
echo %date% %1 %2 %3 %4 %5 %6 %7 >%7\%1.txt

Sample Data

Sample After Execute

Sample Log File

C:\BKFSQLBatch\Win64\test\mysqlprocess.bat "1" "usb key" "10" "c:\images\usbkey.png" "c:\images\" "usbkey.png" "temp"
C:\BKFSQLBatch\Win64\test\mysqlprocess.bat "2" "printer" "100" "c:\images\printer.png" "c:\images\" "printer.png" "temp"
C:\BKFSQLBatch\Win64\test\mysqlprocess.bat "3" "monitor" "110" "c:\images\monitor.png" "c:\images\" "monitor.png" "temp"

Sample Result Preview

Icons made by Smartline from www.flaticon.com is licensed by CC 3.0 BY
Icons merged by icoconvert.com


Related

Wiki: Home