May-21-2017, 09:20 PM
(May-21-2017, 08:47 PM)sahilsiddharth Wrote: import sys
import cx_Oracle
class Customer():
def createCustomer(self,fname):
print ("name is %s" % fname)
db = cx_Oracle.connect('system/12345678@localhost/XE' )
cursor=db.cursor()
cursor.execute("INSERT INTO telm VALUES (fname)")
db.commit()
fname=input("Enter your first name :")
c1=Customer();
c1.createCustomer(fname)
output---
Enter your first name :rahul
name is rahul
Traceback (most recent call last):
File "E:\python\test_cust.py", line 14, in <module>
c1.createCustomer(fname)
File "E:\python\test_cust.py", line 9, in createCustomer
cursor.execute("INSERT INTO telm VALUES (fname)")
cx_Oracle.DatabaseError: ORA-00984: column not allowed here
See the "Bind Variable Patterns" section in this page.
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Your one-stop place for all your GIMP needs: gimp-forum.net