Change sql_interactive to use sqlite3_get_table so that it is not executing the SQL codes multiple times