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: 
Anonymous
Not applicable

Database Running Check?

Does anyone know of functionality that will allow my extracts to immediately start once the databases are up? We have a process that brings our database down and back up at different times anywhere from 5:30, to 6:00. Thus, I would like to schedule the extracts for 5:30, contingent on the databases being up. Some sort of functionality that "pings" the database every minute, and as soon as it's successful the extract starts? TIA.

1 Solution

Accepted Solutions
marcus_sommer

If your used database-driver returned an error if the database isn't available then you could use a loop with a sleep-statement to trigger the call to each minute and the ERRORMODE to fetch the error itself.

- Marcus

View solution in original post

2 Replies
marcus_sommer

If your used database-driver returned an error if the database isn't available then you could use a loop with a sleep-statement to trigger the call to each minute and the ERRORMODE to fetch the error itself.

- Marcus

Anonymous
Not applicable
Author

Thanks. That's where I was headed, but was hoping QV had built in functionality. Here's what I came up with:

// By default (ErrorMode=1) the script execution will halt and the user will be prompted for action

// (non-batch mode). By setting ErrorMode=0 QlikView will simply ignore the failure and continue script

// execution at the next script statement.

LET ScriptErrorCount = 0;

LET ScriptErrorList = '';

a=0

SET ErrorMode=0;

CALL Connectv7;

//  Check ScriptErrorCount for connection problems

DO WHILE a<60 and ScriptErrorCount > 0

    LET a=a+1;

    TRACE >>> Connection attempt $(a) to v7 failed. Reason = $(ScriptErrorList);

    //  Reset ErrorCount and Information

    LET ScriptErrorCount = 0;

    LET ScriptErrorList = '';

    CALL Connectv7;

    SLEEP 60 * 1000; // 60 Seconds

LOOP

IF ScriptErrorCount > 0 THEN

    TRACE >>> Exiting script after $(a) connectiion attempts to v7. $(ScriptErrorCount) $(ScriptErrorList);

    EXIT script;

END IF

SET ErrorMode=1;