Is there a way to get the mysql
cmdline client to abort as soon as it encounters an error, and to return a non-zero exit status to the controlling shell script.
Basically I want to be able to have a shell script like:
mysql -A --batch <<END_SQL
UPDATE table1...
UPDATE table2...
...
END_SQL
if [ $? -ne 0 ]
then
# Error handling
fi
With oracle I just had to put WHENEVER SQLERROR EXIT FAILURE
at the top of the sql commands. Is there a mysql equivalent? Not found anything in google.