Raising exception during SQLite database connection in Python
Question: Here is my code snippet:-

    
    
    import sqlite3
    database = "sample.db"
    def dbConnection(database):
        try:
            connection = sqlite3.connect(database)
            db_cursor = connection.cursor()
            db_cursor.execute("show tables;")
            rows = db_cursor.fetchall()
            for row in rows:
                print row
            connection.close()
        except sqlite3.Error, e:
            print "Error in connection",e
    dbConnection("enb.db")
    

It is raising this exception:-

    
    
    Error in connection near "show": syntax error
    

I can't see anything wrong with the syntax as I just want to view the tables
in the database. What could be the problem here?Thanks


Answer: "SHOW TABLES" is not supported by SQLite. It is valid for other databases such
as MySQL.

[SQLite sql reference](http://sqlite.org/lang.html)

[How to 'show tables' in SQLite](http://stackoverflow.com/questions/82875/how-
do-i-list-the-tables-in-a-sqlite-database-file)

