I am using MySQL Connector/Python to run MySQL from my iPython notebook.
I am wondering, can I create a temporary table this way?
The documentation says nothing about temporary tables, and makes it seem that you would have to define a table before using it.
I am trying something along these lines:
cnx = mysql.connector.connect(user='me',
password='something',
host='somewhere',
port='3306',
database='some_db')
query = "CREATE TEMPORARY TABLE IF NOT EXISTS " +\
"my_temp_table " +\
"AS " +\
"SELECT a_col" +\
"FROM
. . .
;"
When I try this from iPython, it runs and gives no response, yet the temp table has not shown up in the database.
Thanks for your help in advance.