title: Entering data in oracle 11g from semicolon separated text file using python
body: <p>Hi I am trying to enter data that is stored in semicolon separated text file using cx_Oracle(Python).</p>
  
  <pre><code>conn = co.connect('system/ayush@127.0.0.1/xe')
  cur = conn.cursor()
  f = open("C:\\Users\\goyal\\district.txt","r")
  
  for line in f:
      record_split = line.split(";")
      cur.execute("INSERT INTO Demographic('A1','A2','A3') VALUES 
          (record_split[0],record_split[1],record_split[2])") 
  conn.commit()
  </code></pre>
  
  <p>However , it is giving me following error</p>
  
  <pre><code>DatabaseError                             Traceback (most recent call last)
  &lt;ipython-input-16-4cbe704bce0e&gt; in &lt;module&gt;()
          4 for line in f:
          5     record_split = line.split(";")
    ----&gt; 6     cur.execute("INSERT INTO Demographics('A1','A2','A3') 
                VALUES(record_split[0],record_split[1],record_split[2]")
          7 conn.commit()
  
  DatabaseError: ORA-00928: missing SELECT keyword
  </code></pre>
  
  <p>Why is this error coming and how to solve this?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I find python tutorial of reading csv and found this method</p>
  
  <pre><code>lines = csv.reader(open("district.txt","r"),delimiter=';')
  next(lines,None)
  for line in lines:
       cur.execute("INSERT INTO Demographics(A1,A2,A3) VALUES(:1,:2,:3)",line) 
  
  conn.commit()
  </code></pre>
  
  <p>However this read everything as text (even integer and float value) . So to enter value in database I have to explicitly change value to int and float is there any better way.</p>