I am trying to run a fairly complex SQL query from Python (Pandas) and am running into a question I see regularly. My SQL query is about 150 lines, and it is performing multiple tasks, accessing multiple(2) different databases, creating temp tables (6 to be exact), running updates to the tables, etc.
I don't see a way to alter my code reasonably to make this SQL script 'streamlined' and have tried to add 'NO COUNT ON', with no avail. I get the none type error.
All the examples I see are very small bits of code, has anyone solved for this for more complex queries? Aside from the length of the query, I only need to update 3 components each month - run and extract.
I am just really trying to make it a hands off process at this point.
I've been attempting to run using a stationary file location, running some quick replace methods then running the read_sql_query.
Error, and I was expecting to be able to place results into a pandas dataframe and basically copy paste to an external file.