parameters: (self, schema=None, add_sys_tables=False)
return_statement: return listTables
docstring: Get list of tables.
docstring_summary: Get list of tables.
docstring_tokens: Get list of tables .
function: def getTables(self, schema=None, add_sys_tables=False):
          """Get list of tables."""
          if self.hasCache() and not self.populated:
              self.populated = True
              return self.getTablesCache(schema)
  
          tablenames = []
          items = []
  
          try:
              vectors = self.getVectorTables(schema)
              for tbl in vectors:
                  tablenames.append((tbl[2], tbl[1]))
                  items.append(tbl)
          except DbError:
              pass
  
          if self.allowGeometrylessTables:
              # get all non geographic tables and views
              prefix = u"ALL"
              owner = u"o.owner"
              where = u""
              if self.userTablesOnly:
                  prefix = u"USER"
                  owner = u"user As OWNER"
              if schema and not self.userTablesOnly:
                  where = u"AND o.owner = {} ".format(
                      self.quoteString(schema))
  
              sql = u"""
              SELECT o.OBJECT_NAME, {0},
                     CASE o.OBJECT_TYPE
                     WHEN 'VIEW' THEN 1
                     ELSE 0 END As isView
              FROM {1}_OBJECTS o
              WHERE o.object_type IN ('TABLE','VIEW','SYNONYM')
              {2} {3}
              ORDER BY o.OBJECT_NAME
              """.format(owner, prefix, where,
                         u"" if add_sys_tables
                         else u"AND o.OBJECT_NAME NOT LIKE 'MDRT_%'")
  
              c = self._execute(None, sql)
              for tbl in self._fetchall(c):
                  if tablenames.count((tbl[1], tbl[0])) <= 0:
                      item = list(tbl)
                      item.insert(0, Table.TableType)
                      items.append(item)
  
              c.close()
  
          self.populated = True
  
          listTables = sorted(items, key=cmp_to_key(lambda x, y: (x[1] > y[1]) - (x[1] < y[1])))
  
          if self.hasCache():
              self.updateCache(listTables, schema)
              return self.getTablesCache(schema)
  
          return listTables
function_tokens: def getTables ( self , schema = None , add_sys_tables = False ) : if self . hasCache ( ) and not self . populated : self . populated = True return self . getTablesCache ( schema ) tablenames = [ ] items = [ ] try : vectors = self . getVectorTables ( schema ) for tbl in vectors : tablenames . append ( ( tbl [ 2 ] , tbl [ 1 ] ) ) items . append ( tbl ) except DbError : pass if self . allowGeometrylessTables : # get all non geographic tables and views prefix = u"ALL" owner = u"o.owner" where = u"" if self . userTablesOnly : prefix = u"USER" owner = u"user As OWNER" if schema and not self . userTablesOnly : where = u"AND o.owner = {} " . format ( self . quoteString ( schema ) ) sql = u"""
              SELECT o.OBJECT_NAME, {0},
                     CASE o.OBJECT_TYPE
                     WHEN 'VIEW' THEN 1
                     ELSE 0 END As isView
              FROM {1}_OBJECTS o
              WHERE o.object_type IN ('TABLE','VIEW','SYNONYM')
              {2} {3}
              ORDER BY o.OBJECT_NAME
              """ . format ( owner , prefix , where , u"" if add_sys_tables else u"AND o.OBJECT_NAME NOT LIKE 'MDRT_%'" ) c = self . _execute ( None , sql ) for tbl in self . _fetchall ( c ) : if tablenames . count ( ( tbl [ 1 ] , tbl [ 0 ] ) ) <= 0 : item = list ( tbl ) item . insert ( 0 , Table . TableType ) items . append ( item ) c . close ( ) self . populated = True listTables = sorted ( items , key = cmp_to_key ( lambda x , y : ( x [ 1 ] > y [ 1 ] ) - ( x [ 1 ] < y [ 1 ] ) ) ) if self . hasCache ( ) : self . updateCache ( listTables , schema ) return self . getTablesCache ( schema ) return listTables