-1

I used the following code to create a table in python.

import cx_Oracle as db

conn = db.connect('scott/tiger@localhost/orcl')  
cursor = conn.cursor()  
cursor.execute("create table films(title varchar(10), year varchar(10), director varchar(10))")  
print("table created")  

but when i tried to access the table from SQLplus it says that the table doesnt exists.
when tried to run the code again i got the error

"cx_Oracle.DatabaseError: ORA-00955: name is already used by an existing object"

what went wrong here.

I just started to learn python. your help is much appreciated.

  • It does _not_ say that the table doesn't exist. It says that the _"name is already used by an existing object"_, i.e. the table _exists_. You only need to create it once... – Ben Sep 28 '13 at 06:06
  • @Ben: Ah, [Oracle DDL is indeed not transactional](http://stackoverflow.com/questions/4711447/oracle-ddl-and-transaction-rollback). I'll remove the comment. – Martijn Pieters Sep 28 '13 at 06:28

1 Answers1

-1

Perhaps you are using 2 different databases