python eager wrote: > Hi, > > i am using prepared statment.While passing the value i am getting the > following error > > DatabaseError: ORA-01036: illegal variable name/number > > _Code Snippet :_ > a=cursor.prepare("DELETE FROM PERSONALDETAILS WHERE PID =?") > cursor.execute(a,(id)) > > Please rectify the error > > regards > Python Eager
You don't need a prepared statement. Oracle and cx_Oracle will take of this for you. Refer to my previous answer to your questions, the archives of this mailing list are available at http://mail.python.org/pipermail/db-sig/ Your session should be something like; >>> a = cursor.execute("DELETE FROM personaldetails WHERE pid = :pid", {"pid": id}) Or even; >>> a = cursor.execute("DELETE FROM personaldetails WHERE pid = :pid", (id,)) Please try different combinations in an interactive session because this is the best way to find out what works and what doesn't. Regards, Andy -- -------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com/ _______________________________________________ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig