473,320 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Sequence Error ORA-02287

Hi,

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.

Jul 19 '05 #1
2 18055

Do not use a sequence in a where-clause, a query with an order by, group
by, distinct, a set operation, an aggregate function, in a delete, in a
view, or anywhere other than an insert, update, or select.

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
Jul 19 '05 #2

Thanks for the reply,

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

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: NotNeo | last post by:
I am getting a strange symptom: tnsping and sqlplus work fine on my LINUX server (neo) so the listener and DB are OK. However, from my remote XP Client (tank) I get TNS-12560. I can ping the neo...
1
by: Steve Morrell | last post by:
Hi there, I'm trying to write a piece of sql to set an Oracle sequence's nextval to a number specified my the max value in a set of columns. The sequence is populating these columns, so I want...
1
by: Galina | last post by:
Hello I have created a trigger not to let records with certain fields null to be inserted into the table: BEGIN IF :new.RUL_CODE is null or :new.FES_UINS_CODE is null or :new.FES_UIO_CALOCC is...
1
by: Park Yeon Jo | last post by:
About Error : ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect descriptor I installed Oracle 8.1.7 on Windows XP Professional. and I wanto connect to that server...
2
by: Hodge | last post by:
I am trying to use the OracleDatatAdapter to connect to an oracle version 7.3.4.4 server. I am using an oracle 9i client. When i configure the adapter, the connection works and i can select from...
8
by: CJM | last post by:
I have a working web application (ASP) which links to an Oracle 10g DB via OO4O. I'm trying to port it to either of two test servers, but in fact, I can't get it to work with either - 'Unable to...
1
by: janakivenk | last post by:
Hello, I am running Oracle 10g R2 in our office. I created the following procedure. It is suppose to access an xml file ( family.xml). The procedure is compiled and when I try to run it, i get the...
0
by: janakivenk | last post by:
Hello, I am running Oracle 10g R2 in our office. I created the following procedure. It is suppose to access an xml file ( family.xml). The procedure is compiled and when I try to run it, i get the...
1
by: hoonig | last post by:
I have this traditional error "ORA-12560:TNS:Protocol Adapter Error" when trying to connect to my Oracle 8i databases on Netware (i.e when i load svrmgr31, plus81, etc...) Listener seems to work...
2
by: devas | last post by:
Hai, Issue: I am using OEM 10g grid control. I want to establish the connection from oracle to sql server=>I can’t able to connect it. Please help me I have created the system dsn below steps....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.