[Tutor] SQL Server Script

Dylan Armstrong dylanarmstrong43 at yahoo.com
Mon Apr 17 12:18:07 EDT 2023


Hello,
I'm trying to create a python script that exports the results of a query from sql into an excel file. I got the original version of the code to work but I want to add python variables into my sql code because of the weird variable format differences between oracle and sql variables. I heard that you can insert python variables into the code by placing a ":" before the variable, declaring the variable after the sql query is defined, and having a curser execute the query with the variables as parameters but I'm not sure how to do that last step. I'm also not sure how to give a specific file path destination for my newly created excel file. I'm using oracledb and pandas. my python version is 3.10.11. Sensitive information has been replaced by generic variables.


More information about the Tutor mailing list