title: How to execute .sql file on cx_oracle?
body: <p>I want to execute a .sql file using cx_Oracle. I have to execute many files and the statements may or may not contain ';' before termination. I have gone though following solution</p>
  
  <pre><code>f = open('tabledefinition.sql')
  full_sql = f.read()
  sql_commands = full_sql.split(';')
  
  for sql_command in sql_commands:
      curs.execute(sql_command)
  </code></pre>
  
  <p>but this does not work. 
  Is there any way to pass file as parameter like i do for connection as follows:</p>
  
  <pre><code>dsn_tns = cx_Oracle.makedsn('server', 'port', service_name='service_name')
  conn = cx_Oracle.connect(user='username', password='password', dsn=dsn_tns)
  </code></pre>
  
  <p>like sql_file = 'mysql.sql' ? </p>