community.borland.com

Article #25441: How to allow the QLI script to exit out automatically using command

Problem:
There are many occasions when you would like to run
QLI scripts from cron jobs or from just command line.

For example:  Suppose you run a command like..
                qli -a 

where the script contains statements like...
                ready database foo.gdb
                ---
                -----
                end

The problem is that, if the network is down, and the first
statement in the script does not go through, your script aborts
and the you get stuck at the QLI command prompt or with the
"CON>" prompt inside QLI.  This is going to mess up your
cron job.. or your master script, if you are running one that contains
a  series of "QLI -a " commands.. 


Solution:
To solve this problem supply extra arguments "quit"
following the qli command line syntax.  For example..
            " qli -a  quit quit "


So, if the script fails, or if the database fails to connect,
the second argument "quit" gets executed, and the QLI session
gets aborted.

However, if the script runs fine, the second argument gets
ignored.  You could submit two "quit" keywords, to ensure, clean
recovery.        
  

Last Modified: 26-OCT-00