sequence « Development « Java Database Q&A





1. How to retrieve sequences metadata from JDBC?    stackoverflow.com

I am trying to retrieve different kind of metadata of my Oracle DB from Java code (using basic JDBC). For example, if I want to retrieve the list of tables with ...

2. fetch out of sequence    coderanch.com

3. storing sequence array in DB    coderanch.com

greetings! I have a business problem where I need to store a list of values in a sequence associated with a key, in db. Let me explain in detail. In my application, there is are different workflows defined in a company. Any proposal entered by anyone follows one of the workflow which is basically the sequence of the Approvers. Proposal is ...

4. Fetch out of sequence    coderanch.com

### Detailed Problem Statement: ### We are using the JDriver that comes with weblogic 6.1 to access Oracle9i database. The java version is 1.3 and jdbc version is 2.0. The connection pool is created sucessfully. When trying to execute the query the following error is generated. The error is the same for all types of queries such as select count(*) from ...

5. ora-01002 "Fetch out of Sequence"    coderanch.com

Hi We are using WebLogic 5.1 and Oracle 8.1.7.2. We just recently switched to Service pack 13 and have been getting this ora-01002 "Fetch out of Sequence" error within JAVA code that was running fine before the conversion. The requests are not request "FOR UPDATE". Any ideas??? Any help would be appreciated! Please contact me at hegmartin@yahoo.fr or or post a ...

6. How to use escape sequence    coderanch.com

7. about add the id number according the existing sequence    coderanch.com

I have an existing sequence called TOPICSEQ in the database(oracle), there is a table called t_topic whose id is incremented using this TOPICSEQ. The detail of this seq is created like following CREATE SEQUENCE TOPICSEQ INCREMENT BY 1 START WITH 1001 MAXVALUE 9999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER; It works fine when populating the db with scripts, but when inserting ...

8. sequence to a field    coderanch.com

I've re-read your posts: you are not actually using a sequence are you? Be careful before you rush to answer that - "sequence" (in this context) is an Oracle/Postgres specific term, so if its not either you are using, then ignore my previous post. If however it is, the syntax for selecting the next value from a sequence is "select seq_name.nextval ...

9. how to get the next sequence number ..    coderanch.com

hi guys , i have a problem getting the sequence number. i have a table named customer .. where i have want to auto generate the customer id .. so i have used sequence on customer id .. now if i want to insert a new customer from my java program ..first i shud get the sequence number .. how do ...





10. problem with sequence    coderanch.com

11. ORA-01002:fetch out of sequence    coderanch.com

In a host language program, a FETCH call was issued out of sequence. A successful parse-and-execute call must be issued before a fetch. This can occur if an attempt was made to FETCH from an active set after all records have been fetched. This may be caused by fetching from a SELECT FOR UPDATE cursor after a commit. A PL/SQL cursor ...

12. sequence number generation    coderanch.com

I am working on a stored procedure which selects certain records. But I have a situation where I have to append a 2 digit sequnce number for every record. I dont think its going to be a problem if it repeats after 99, but I have to generate a 2 digit sequence number. I tried using dbms_random but it generates only ...

13. Cloudscape Create Sequence    coderanch.com

Hi all, This is the syntax i am trying to use to create sequence for pkcolumn of table. CREATE SEQUENCE PORTAL.KEY_ID START WITH 1 INCREMENT BY 1 CACHE 20; I am getting the following error upon execution. Starting execution CREATE SEQUENCE PORTAL.KEY_ID START WITH 1 INCREMENT BY 1 CACHE 20; SQL Exception: Syntax error: Encountered "PORTAL" at line 1, column 17. ...

14. ora-01002 fetch out of sequence    coderanch.com

hi friends, I have stuck up with a problem. The problem is that i am getting fetch out of sequence(ORA-01002) sql exception. This error is occurring when i am trying to get the resultset object from the ref cursor. By using the following code stmt = conn.prepareCall(procedure(?,?)); stmt.registerOutParameter(2, OracleTypes.CURSOR); stmt.setString(1,ttid); stmt.execute(); rs=(ResultSet) stmt.getObject(2); Actually in the procedure i am just opening ...

15. Sequence generator    coderanch.com

We're writing an application that needs to be able to insert records into a database with a unique id. The DBMS we have to use is ancient and doesn't support auto-increment or any such nifty features. So far, we query the database for the maximum value, add 1 to that and insert the new record with the new number. This approach ...

16. Returning a sequence id    coderanch.com





18. Java Code does not recognize my sequence name    coderanch.com

Hi,i have a strange problem. My sequence name is not getting recognized inside my insert statement written in String inside my DAO. I am sure the sequence name is right because i executed "select sws_user_sequence.currval from dual" gives me the right value in sql Developer tool. Only thru the java code as written below, the compiler throws a sql exception ORA-02289: ...

20. pls tell how use sequence number    coderanch.com

21. Can we create auto key generation(sequence) for composite PK    coderanch.com

a surrogate key (a key generated from a sequence is independent of any logic or rules related to the row it identifies) and is by definition unique. a composite key is used with natural keys or to identify a row in a fact table. what is it you are trying to make unique with a composite key?

22. Is there a generic way to get sequence    coderanch.com

23. sequence creation    coderanch.com

25. Using Sequence to populate ID(SOLVED)    coderanch.com

I have never used sequences in pl sql before, so I am just wondering if it is best practice to use seq.nextval or seq.currval? I do not know if using .currval will use the current number, and then the next time it is used ti will use the next number in line, or if .currval will keep using the same number ...