I am trying to pass the parameter to the SQL script from python.
below is the script I am trying; please let me know what I am doing wrong here...
#!./bin/python
_author_='Mohammed'
import boto3
import cx_Oracle
import sys
con = cx_Oracle.connect('username/password@localhost:1521/DBName')
print con.version
cur=con.cursor()
statements = open('$location/test.sql').read().format('localhost')
cur.execute(statements)
query_result=cur.fetchall()
for res in query_result:
print(res)
************Error***********
Traceback (most recent call last):
File "$location\test1.py", line 19, in <module>
statements = open('$location/test.sql').read().format('localhost')
IndexError: tuple index out of range