Re: [cx-oracle-users] DDL prepared problem
Brought to you by:
atuining
From: sky2roy s. <sk...@gm...> - 2010-09-04 02:40:15
|
cursor.execute() is simple. and can i change the sql and replace text. but . i just want to know why cx_oracle is not support this? or my code has an error? other language dao support this... my problme is cleared. using cursor.execute .. thanks. code ======================== parameters["std_id"] = "10000" sql = " create table copy_student as select * from student where std_id = %s " cursor.execute(%s % parameters["std_id"]) ======================== 2010/9/3 Anthony Tuininga <ant...@gm...> > Just curious: why are you using cursor.prepare()? Why not simply use > cursor.execute()? > > On Fri, Sep 3, 2010 at 3:28 AM, sky2roy sky2roy <sk...@gm...> wrote: > > hi. > > > > I am working with python 2.4 , cx_Oracle-5.0.3 > > > > i am trying to execute ddl sql. but it has an error. > > > > like this sql. " create table copy_student as select * from student > where > > std_id = ?" > > not exactly this sql ..... just focus on prepared DDL > > > > there is sample code and error message. > > > > sample code > > ======================== > > parameters = {} > > parameters["std_id"] = "10000" > > sql = " create table copy_student as select * from student where std_id > = > > :std_id " > > cursor.prepare(sql) > > cursor.execute(None, parameters) > > ======================== > > > > error message > > ================ > > > > DatabaseError: ORA-01036: illegal variable name/number > > > > ================= > > > > i think prepared DDL sql is not bined. so this is bugs or not suppoert > sql? > > > > > > > > > ------------------------------------------------------------------------------ > > This SF.net Dev2Dev email is sponsored by: > > > > Show off your parallel programming skills. > > Enter the Intel(R) Threading Challenge 2010. > > http://p.sf.net/sfu/intel-thread-sfd > > _______________________________________________ > > cx-oracle-users mailing list > > cx-...@li... > > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > > > > > > ------------------------------------------------------------------------------ > This SF.net Dev2Dev email is sponsored by: > > Show off your parallel programming skills. > Enter the Intel(R) Threading Challenge 2010. > http://p.sf.net/sfu/intel-thread-sfd > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |