After an insert using nextval I try:
SELECT * FROM tblClients WHERE fldclient_id = (SELECT
client_id_seq.currval from Dual)
and get:
java.sql.SQLException: ORA-02287: sequence number not allowed here
I've read lots on sequence's etc and I can't see why I cant get the
currval.
(I'm in Jdeveloper btw)
Thanks,
Jim.
Please look in Oracle8i SQL Reference for the rules on when to use sequence
values CURVAL and NEXTVAL.
--
Message posted via http://www.dbmonster.com
Sorry if this is more of a Java question rather than o.d:
Ok, I'm now putting the currrval into a variable. My query returns a
RecordSet, could anyone tell me how to get the value from the RecordSet
into a variable.
Whats wrong with this:
RecordSet myResults = DatabaseConnection.ExecuteQuery("SELECT
my_seq.currval FROM DUAL");
int currentValue = myResults.getInt("my_seq.currval");
Thanks for any answers,
Jim