Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
GaryNY #1
Problem with Oracle sequence
I defined an Oracle sequence, which is used in my application to generate
unique increasing numbers.
I set it from 1 with increment also 1, expecting it to grow by 1.
The definition in USER_SEQUENCES table is correct.
When I test this sequence in SQL*Plus session it returns expected values in
CURRVAL and NEXTVAL functions.
To contrary, my CF application, which uses this sequence in it's SQL (via
NEXTVAL), gets new numbers in different unpredictable fashion. Sometimes
several hundred greater then the previous number.
Does anybody met this before ?
What could be the problem ?
GaryNY Guest
-
INSERT and Oracle SEQUENCE values
Thanks to anyone who can help. I am using an ORACLE sequence when adding records to my DB, and using an INSERT statement to use the sequence. I'd... -
Problem with the sequence
Thanks that should help but what about the rest of the columns can u explain what is "is_cycled" and "cache_value". Thanks in advance. Richard... -
Problem with Autogenerated sequence
Hi, I have a problem with the SEQUENCE generation. I have a column in a table which auto increments by 1 every time there is a entry and I am... -
Import Sequence problem <<<<<TRY @, any MM support here?>>>>>>
Still have this incredibly annoying problem. Director MX, XP, Ram=2 mb, new P4 etc... I CAN drag the images from a desktop folder into the Cast... -
#23668 [Opn->Fbk]: oracle<defunct> problem apache2+php+oracle
ID: 23668 Updated by: sniper@php.net Reported By: thecluster at argentina dot com -Status: Open +Status: ... -
frankjshin #2
Re: Problem with Oracle sequence
Did you use something like the following to set up the sequence?
CREATE SEQUENCE seq_name
MINVALUE 1
MAXVALUE 100000
START WITH 1
INCREMENT BY 1
CACHE 20;
Then to insert the autonumber in a query:
<cfquery name="test" datasource="#ds1#">
INSERT INTO test_table
(test_id, test_name)
VALUES
(seq_name.nextval, 'Test123');
That works for me just fine.
Frank
</cfquery>
frankjshin Guest
-
GaryNY #3
Re: Problem with Oracle sequence
Something like that, I also extracted NEXTVAL for constructing unique names (in combination with other chars).
But it is incremented in gaps...
GaryNY Guest
-
frankjshin #4
Re: Problem with Oracle sequence
Can you put in the actual code you used in SQL PLUS to create the sequence and the query?
frankjshin Guest
-
GaryNY #5
Re: Problem with Oracle sequence
It was the standard code, increment was set to 1, NOMAX, NOCYCLE.
GaryNY Guest



Reply With Quote

