Please use SEQUENCE. You need to have DBA privilege to create this.
Syntax is:
CREATE SEQUENCE seq_name
START WITH 1
INCREMENT BY 1
NOMINVALUE
MAXVALUE 1.000E+27
NOCYCLE
NOCACHE
ORDER
/
In your query, you can get next value like this:
SELECT seq_name.NEXTVAL FROM DUAL;
Or if you need this value to be inserted to your data table...
INSERT INTO data_table (column1, column2) VALUES(seq_name.NEXTVAL, "some value");
David
-----Original Message-----
From: shashi kanth goud [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 03, 2003 4:39 AM
To: [EMAIL PROTECTED]
Subject: Re: help regarding oracle
hi everybody,
iam working on oracle 7 . i want to use auto counter field in oracle can anyone tell me how to do it????
thanx in advance
Regards
Shashi
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
------------------------------------------------------------------------------
This email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else, unless expressly approved by the sender or an authorized addressee, is unauthorized.
If you are not the intended recipient, any disclosure, copying, distribution or any action omitted or taken in reliance on it, is prohibited and may be unlawful. If you believe that you have received this email in error, please contact the sender, delete this e-mail and destroy all copies.
==============================================================================
Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
