title: Python code to load data from csv file into Oracle Table
body: <p>I am trying to load data from csv to oracle table.
  I am using following python code to load data from csv to oracle table.</p>
  <p>Note: CSV file has over 1 Million records.</p>
  <pre><code>csv_input=pd.read_csv(r&quot;C:\python\test.csv&quot;,index_col=False,na_values=&quot; &quot;).fillna('')
  
  
  try:
      conn = orcCon.connect('scott/tiger@localhost:1521/orcl',encoding=&quot;UTF-8&quot;)
      if conn:
          print(&quot;cx_Oracle version:&quot;, orcCon.version)
          print(&quot;Database version:&quot;, conn.version)
          print(&quot;Client version:&quot;, orcCon.clientversion())
          
          # Now execute the sqlquery 
          cursor = conn.cursor()
          print(&quot;You're connected.................&quot;)
          print(&quot;TRUNCATING THE TARGET TABLE&quot;)
          cursor.execute(&quot;TRUNCATE TABLE TEST1&quot;)
          print(&quot;Inserting data into table&quot;)
          for i,row in csv_input.iterrows():
              sql = &quot;INSERT INTO TEST1(SAMPLE1,SAMPLE2,SAMPLE3,SAMPLE4,START,END,SAMPLE5,SAMPLE6)VALUES(:1,:2,:3,:4,TO_DATE(:5,'YYYY-MM-DD'),TO_DATE(:6,'YYYY-MM-DD'),:7,CASE :8 WHEN 1 THEN 'TRUE' ELSE 'FALSE' END)&quot;
              cursor.execute(sql, tuple(row))
              # the connection is not autocommitted by default, so we must commit to save our changes
              conn.commit()
              #print(&quot;Record inserted successfullly&quot;)
  except DatabaseError as e:
      err, = e.args
      print(&quot;Oracle-Error-Code:&quot;, err.code)
      print(&quot;Oracle-Error-Message:&quot;, err.message)
  
  finally:
      cursor.close()
      conn.close()   
  </code></pre>
  <p>But it is taking 45-60 Minutes to load the data from csv to Oracle table.</p>
  <p>Please suggest me python code to load data from csv with Batch insert of 1000 records</p>