Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

insert

don123Dec 7 2016 — edited Dec 11 2016

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/tiger@test')

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()

This post has been answered by Christopher Jones-Oracle on Dec 11 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 8 2017
Added on Dec 7 2016
1 comment
301 views