Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem using bat file

Hi Forum

I have a Batfile (this has 100 lines approx) that loads data from progress database . Sometimes I obtain the next error with direrent tables:

SQL Error:[OpenLink][ODBC][Driver]Syntax error or access
SQL Scriptline:
SQL State:37000
SQL SELECT ter ,
ter1
FROM NOV

If i test the ODBC it´s OK (Administrative Tools -> Data Sources(ODBC). And if i run the script from QlikView It´s works OK.

The issue occurs (sometimes) with the schedule Task. But i dont know why.

Basically I need to ensure the daily reload . What is the proper way of doing this?


Thanks a lot.

4 Replies
prieper
Master II
Master II

Are you sure that required server is always available? If not, you may build a loop within the batch ("IF ERRORLEVEL = 1 ...."). When there are constant transactions going on, the parameter "NO LOCK" in the SQL-query may help.

HTH
Peter

Not applicable
Author

Thanks for your reply. i think that the server is available. I have two servers A (Production) and B (Test).

Because i have to migrate to new server (B). A and B are conected to the same Progress Database.

The shcedule tasks (A and B) run at the same hour. Server A works OK. But sometimes Server B generates the error
(SQL Error:[OpenLink][ODBC][Driver]Syntax error or access) with diferernt tables.

How can i build the loop ?


Thaks a lot.

prieper
Master II
Master II

You may have a look into the structure of batch-files, but script should look like (untested):

:Reload
SET Errorlevel = 0
... Here comes your reload-sequence
IF Errorlevel 1 THEN GOTO Wait
:Wait
WAIT 60
GOTO Reload
:End
.... Clean up and finish


Reload-sequence is typically like "C:\Program Files\QlikView\QV.exe" /r "C:\Directory\QVapplication.qvw"
Wait-command tells the batch to wait xxx seconds before reloading.

HTH
Peter

Not applicable
Author

Thanks a lot Peter.