In my Python code I want to execute commands like the following two lines:
sql1 = "SELECT f1, f2, f3 from mytab"
exitCode = subprocess.call(sql1,shell=True)
The above commands work. But the problem is that the sql1 string is often very big. I have the unix Shell script equivalent of the above two lines:
bq query .... " `cat q1.sql`"
where s1.sql is a file containing the sql statement and it works with all sql statements with line breaks, etc.
How could I change the Python code above so that it will accept a shell script "cat" like command to get the content of the file for the sql query?
Thanks a lot.