Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
get column names of a table from a database.

        def getColumnNames( dbhandle, table ):
    '''get column names of a table from a database.'''
    
    cc = executewait( dbhandle, "SELECT * FROM %s LIMIT 1" % table )
    return tuple([ x[0] for x in cc.description ])
        


src/c/g/CGAT-0.2.0/CGAT/Pipeline.py   CGAT(Download)
        d = Database.executewait( dbhandle,"SELECT COUNT(DISTINCT %s) FROM %s" % (track,table))
        tracks.append( d.fetchone()[0] )
        columns.append( [x.lower() for x in Database.getColumnNames( dbhandle, table ) if x != track ] )
 
    E.info( "creating %s from the following tables: %s" % (tablename, str(zip( tablenames, tracks ))))

src/c/g/CGAT-0.2.0/CGAT/Expression.py   CGAT(Download)
    ## build convenience table with tracks
    tablename = prefix + "_isoform_levels"
    tracks = Database.getColumnNames( dbhandle, tablename )
    tracks = [ x[:-len("_FPKM")] for x in tracks if x.endswith("_FPKM") ]
 

src/c/g/cgat-HEAD/CGAT/Expression.py   cgat(Download)
    # build convenience table with tracks
    tablename = prefix + "_isoform_levels"
    tracks = Database.getColumnNames(dbhandle, tablename)
    tracks = [x[:-len("_FPKM")] for x in tracks if x.endswith("_FPKM")]