def METHOD_NAME():
  conn = get_connect()
  cur = conn.cursor()
  cur.execute("select effective_tenant_id()")
  rs = cur.fetchone()
  if rs[0] != g_config.tenant:
    print >> sys.stderr, 'tenant id not equal %d <> %d' % (rs[0], g_config.tenant)
    sys.exit(-1)
  state = 0
  for line in sys.stdin:
    line = line.strip()
    if len(line) != 0 and line[0] != '#':
      if len(line) >= 3 and line[:3] == 'use':
        print >> sys.stderr, 'change database: %s' % line
        try:
          cur.execute(line)
          state = 0
          g_import_stat.succ_db_count += 1
        except:
          g_import_stat.fail_db_count += 1
          print >> sys.stderr, 'fail to execute: %s' % line
          state = 1
      else:
        if state == 0:
          try:
            cur.execute(line)
            g_import_stat.succ_outline_count += 1
          except:
            print >> sys.stderr, 'fail to execute: %s' % line
            g_import_stat.fail_outline_count += 1
        else:
          g_import_stat.fail_outline_count += 1
          print >> sys.stderr, 'skip to execute: %s' % line
  print >> sys.stderr, "db succ %d | db fail %d | outline succ %d | outline fail %d" % (g_import_stat.succ_db_count, g_import_stat.fail_db_count, g_import_stat.succ_outline_count, g_import_stat.fail_outline_count)