Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

Incremental fields in oracle

Hello,

How can i create incremental fields in Oracle ,
Please  .. example ...

thank u
Asi
0
asi
Asked:
asi
1 Solution
 
aubsCommented:
If you mean like the autoinc field type of paradox/access
then the answer is that no such field type exists in Oracle.

You need to create a sequence and use the nextval and currval
properties of the sequence.



CREATE SEQUENCE MYSEQ;

INSERT INTO MYTABLE
(TAB_ID, CUSTOMER_NAME,...)
VALUES
(MYSEQ.NEXTVAL, 'Fred Bloggs',....)
0
 
CleanupPingCommented:
asi:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
Lukasz LachCommented:
asi,
No comment has been added lately (18 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Award points to aubs http:#7145864

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

anAKiN
EE Cleanup Volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now