Re: [cx-oracle-users] Can't get nextval
Brought to you by:
atuining
From: Antonio B. M. <ant...@li...> - 2004-02-26 16:13:42
|
query =3D "SELECT allocation_seq.nextval FROM allocation" self._cursor.execute(query) newid, =3D self._cursor.fetchone() print newid But it returns nothing...=20 If I do: self._cursor.execute('select * from user_sequences') r =3D self._cursor.fetchall() print r ------------------- [('ALLOCATION_SEQ', 1, 999999999999999999999999999L, 1, 'N', 'N', 20, 81)= ] ------------------- El Jue 26 Feb 2004 15:54, Anthony Tuininga escribi=F3: > Could you send us the exact code you are using? This code works for me: > > import cx_Oracle > > connection =3D cx_Oracle.connect("user/pw@tns") > cursor =3D connection.cursor() > cursor.execute("select users_seq.nextval from dual") > seqValue, =3D cursor.fetchone() > > On Thu, 2004-02-26 at 04:56, Antonio Beamud Montero wrote: > > Hi all: > > I've a big problem because I neet to get the nextval in a sequence, a= nd > > the query returns an empty sequence. > > If I make a query like : INSERT INTO XXXX VALUES (users_seq.nextval, = =2E..) > > All works perfectly, but If I try to do this query in two steps: > > SELECT users_seq.nextval FROM XXXX > > INSERT INTO XXXX VALUES (new_id, ...) > > > > the SELECT returns []. > > (This query works with sqlplus) > > > > What I'm doin wrong? > > > > > > ------------------------------------------------------- > > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > > Build and deploy apps & Web services for Linux with > > a free DVD software kit from IBM. Click Now! > > http://ads.osdn.com/?ad_id56&alloc_id438&op=3Dclick > > _______________________________________________ > > cx-oracle-users mailing list > > cx-...@li... > > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |