I'm trying to execute some SQL from the DAL that relies on a temp table:
CREATE TEMPORARY TABLE tmp LIKE people;
INSERT INTO tmp SELECT * FROM people;
INSERT INTO tmp SELECT * FROM people;
SELECT * FROM tmp;
This code works fine in a SQL panel, but fails when used in the DAL:
def test():
db_test = DAL('mysql://root:root@localhost/test')
sql = """CREATE TEMPORARY TABLE tmp LIKE people;
INSERT INTO tmp SELECT * FROM people;
INSERT INTO tmp SELECT * FROM people;
SELECT * FROM tmp;"""
results = db_test.executesql(sql)
Results always returns None. No idea why or how to proceed.
--