#!/bin/sh
flag=`expr $(date +%s --date "$(date +"%Y%m%d 03:00:00" --date "1 days ago")") / 86400`
source /opt/export/home/netview/.profile
dbisql -c "uid=nethouse;pwd=123456;eng=$en" "select count(1) from XXXXX_$flag;    output to '/srv/smartcare/fm/SDR_pkt_app_hour_$flag.csv'"
command1
command2
运行时,提示出错:
-------------------------------------------
Could not execute statement.
  Table  XXXXX_17562 not found
  SQLCODE=-141, ODBC 3 State="42S02"
  Line 1, column 1
  select count(1) from .XXXXX_17562 where starttime=1520456400
  You can continue executing or stop.
1. Stop
2. Continue
--------------------------------------------
问题1:怎么处理数据表不存在时,这个查询不出错误提示,不要出现人工去选择1或者2
问题2:怎么编写,出错也能继续执行下面的程序