Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 16, 2012 10:58 PM by Lannie
Member
376 Points
1048 Posts
May 16, 2012 07:34 AM|LINK
i am using sql developer software, i would like to ask how to set the col. that is identity that mean increase by 1 automatically when insert record
Contributor
2805 Points
534 Posts
May 16, 2012 09:17 AM|LINK
In oracle there is concept of Sequences which is same as SQL identity
http://www.techonthenet.com/oracle/sequences.php
3840 Points
749 Posts
May 16, 2012 10:58 PM|LINK
CREATE SEQUENCE {YOURSCHEMA}.CUSTOMER_SEQ START WITH 1 MAXVALUE 1024000 MINVALUE 1 NOCYCLE NOCACHE NOORDER; GRANT SELECT ON {YOURSCHEMA}.CUSTOMER_SEQ TO {YOURAPPUSERorROLE}; INSERT INTO {YOURSCHEMA}.CUSTOMERS (CUSTOMER_SEQ, CUSTOMER_NAME) VALUES ({YOURSCHEMA}.CUSTOMER_SEQ.NEXTVAL, 'Thomas Jefferson'); COMMIT;
-_-
Member
376 Points
1048 Posts
oracle column
May 16, 2012 07:34 AM|LINK
i am using sql developer software, i would like to ask how to set the col. that is identity that mean increase by 1 automatically when insert record
gaikwad_anil...
Contributor
2805 Points
534 Posts
Re: oracle column
May 16, 2012 09:17 AM|LINK
In oracle there is concept of Sequences which is same as SQL identity
http://www.techonthenet.com/oracle/sequences.php
www.thecodekey.com
Please mark as answer if useful
Lannie
Contributor
3840 Points
749 Posts
Re: oracle column
May 16, 2012 10:58 PM|LINK
CREATE SEQUENCE {YOURSCHEMA}.CUSTOMER_SEQ START WITH 1 MAXVALUE 1024000 MINVALUE 1 NOCYCLE NOCACHE NOORDER; GRANT SELECT ON {YOURSCHEMA}.CUSTOMER_SEQ TO {YOURAPPUSERorROLE}; INSERT INTO {YOURSCHEMA}.CUSTOMERS (CUSTOMER_SEQ, CUSTOMER_NAME) VALUES ({YOURSCHEMA}.CUSTOMER_SEQ.NEXTVAL, 'Thomas Jefferson'); COMMIT;