Forum Stats

  • 3,768,732 Users
  • 2,252,842 Discussions
  • 7,874,701 Comments

Discussions

insert

don123
don123 Member Posts: 815
edited Dec 11, 2016 7:50PM in Python

The following insert does not work. The error is "sql command not properly ended".

How to do this ?

import cx_Oracle

con = cx_Oracle.connect('scott/[email protected]')

cur = con.cursor()

cur.execute("INSERT INTO emp(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES

(:a,:b,:c,:d,to_date(:e,'YYYY-MM-DD'),:f,:g,:h))",

{'a':1000,'b':'JOHN','c':'CLERK','d':2000,'e':'2016-12-06','f':5000,'g':100,'h':10}

)

cur.close()

con.close()

Best Answer

Answers

This discussion has been closed.