Example #1
0
def check_devid(devid,tables):
  tab = tables['userdevice']
  cmd = 'select * from %s where deviceid="%s" and end is NULL'%(tab,devid)
  res = sql.run_data_cmd(cmd)
  if len(res) == 0:
    return False
  return True
Example #2
0
def get_eventsarr():
  events= {}
  cmd = 'select eventid,event from EVENTS'
  res = sql.run_data_cmd(cmd)
  for rec in res:
    events[rec[1]] = rec[0]
  return events
def check_devid(devid, tables):
    tab = tables["userdevice"]
    cmd = 'select * from %s where deviceid="%s" and end is NULL' % (tab, devid)
    res = sql.run_data_cmd(cmd)
    if len(res) == 0:
        return False
    return True
Example #4
0
def get_id_from_table(table, did, ts):
    cmd = 'SELECT id from ' + table + ' where '
    cmd += 'deviceid = "' + did + '" and timestamp = ' + ts
    res = sql.run_data_cmd(cmd)
    return str(res[0][0])
Example #5
0
def get_id_from_table(table,did,ts):
  cmd = 'SELECT id from ' + table + ' where '
  cmd += 'deviceid = "' + did + '" and timestamp = ' + ts
  res = sql.run_data_cmd(cmd)
  return str(res[0][0])