I have a problem with sequences in Oracle 8i:
how can I get the current value (currvalue) of
a database sequence with a Java application?
(sys.sequ is declared as a sequence in the database)
The following Java code works properly:
java.sql.Connection conn;
java.sql.Statement stmt = conn.createStatement();
java.sql.ResultSet rset = stmt.executeUpdate("INSERT INTO sys.table1
VALUES (sys.sequ.currvalue, 2)");
This code results in a error message created by oracle:
java.sql.Connection conn;
java.sql.Statement stmt = conn.createStatement();
java.sql.ResultSet rset = stmt.executeQuery("SELECT sys.seq.currvalue
FROM dual");
--> Error message: "The sequence sequ is not declared in actual session"
(or something similar)
My problem:
I need the current value of the sequence to read it from the ResultSet
in a variable.
thanks in advance
Jojo
Sent via Deja.com http://www.deja.com/
Before you buy.
The current value of a sequence can be obtained
using <sequence name>.currval
Jose Luis Perez
BARCELONA
SPAIN
jojo...@my-deja.com escribió:
HTH
In article <82o5hk$tb4$1...@nnrp1.deja.com>,