I have a parameter file with all param values . I want to pass these values to another .py (raw sql file) and generate an executable sql file Here is what I have so far
params.py file
var1 = '1,2,3'
var2 = '('abc', 'cde', 'xyz')'
rawsql.py
import params
select *
from emp.ids
where ids in var1
and names in var2
The output I'm expecting is a .sql file
exec_sql_file.sql
select *
from emp.ids
where ids in (1,2,3) and
and names in ('abc','code','xyz')
How can I accomplish the variable substation in a .py file from another .py file