[DB-SIG] Re: cx_Oracle and NEXTVAL

Anthony Tuininga anthony at computronix.com
Tue Mar 30 12:48:09 EST 2004


Not sure why you are getting the problems you are getting. Here is the
output from a sample session where I tried to match everything you
mentioned. I am using 9.2.0.3 for both client and server, both hosted on
Linux but I doubt that has any bearing. I have used this style of code
on all of the platforms that cx_Oracle supports without any
difficulties:

first in SQL*Plus

sqlplus user/pw at tns

create sequence sq_report_code_seq_code;

Sequence created.

select sq_rpeort_code_seq_code.nextval from dual;

   NEXTVAL
----------
         1

then in Python

python

import cx_Oracle

connection = cx_Oracle.connect("user/pw at tns")
cursor = connection.cursor()
cursor.execute("select sq_report_code_seq_code.nextval from dual")
result, = cursor.fetchone()

No errors reported. I would suggest examining your Oracle environment a
little more carefully or showing me the exact Python code that fails and
the exact set of SQL that you execute in SQL*Plus to set up the test
case. Thanks.

On Fri, 2004-04-30 at 11:02, Kike Peña wrote:
> Hi.
> 
> I got ahead of my other problems...  but a new one comes into play now.
> I need to execute de query: SELECT sq_report_code_seq_code.NEXTVAL from
> dual;
> from cx_Oracle, this is
> 
> cursor.execute("SELECT sq_report_code_seq_code.NEXTVAL from dual")
> 
> When I do that, it returns an error:
> 
> cx_Oracle.DatabaseError: ORA-00904: "SQ_REPORT_CODE_SEQ_CODE"."NETXVAL":
> invalid
>  identifier
> 
> The sequences and all other things are in order...  because when I run the
> query directly from SQL/PLUS it works fine... but not when I use cx_Oracle.
> 
> All other things are working fine.. (so far) but I have this problem.
> 
> I'm using:
> - Python 2.3.2
> - Oracle 9i
> - cx_Oracle 4.0.1
> on win XP
> 
> Any ideas?
> 
> thnx
> Kepena
-- 
Anthony Tuininga
anthony at computronix.com
 
Computronix
Distinctive Software. Real People.
Suite 200, 10216 - 124 Street NW
Edmonton, AB, Canada  T5N 4A3
Phone:	(780) 454-3700
Fax:	(780) 454-3838
http://www.computronix.com




More information about the DB-SIG mailing list