Members Login.
 

Please register HERE to be part of our Community
Contest of the Day.
 
Current Promotions.
 
Earn By Posting
 
Participate in forum and Earn $$$.
  • Referrer Credit - BRL$ 100
  • Positive Rep Cr. - BRL$ 3
  • New Thread Cr.- BRL$ 3
  • Posting Cr. - BRL$ 2
  • Post size Credit
Full List of BRL$ Earnings
Sponsors.
 


Oracle Database Discussion related to Oracle database issues, queries, questions

Reply
  #1 (permalink)  
Old 03-17-2008
Jr. Member
 
Join Date: Mar 2008
Posts: 263
BRL$: 9.27
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 34
mira is on a distinguished road
Default Auto increment in Oracle

I want to add auto increment field in oracle table. Can anyone tell me how can I add it in oracle?


Current Promotions... Post a New Thread anywhere on Web Development Board to earn BRL$ 5 for every thread. Post a new Reply there and earn BRL$ 3 for every reply.
Important - Read before posting Please carefully read the Global Rules and Posting Rules for GPT / Buy - Sell Offers / Link Exchange sections before posting.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008
Jr. Member
 
Join Date: Apr 2008
Location: California
Posts: 155
BRL$: 161.29
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 21
binary8383 is on a distinguished road
Smile Re: Auto increment in Oracle

hi,

Quote:
I want to add auto increment field in oracle table. Can anyone tell me how can I add it in oracle?
you need to decide whether the auto increment field is a primary key or not.

assume that you have this table employee:-

create table employee(
id number(5),
emp_name varchar2(50),
emp_email varchar2(30)
);


then, you need to create a sequence for that employee table:-
create sequence id_incre
start with 1
increment by 1;

To use it, you can either use it in a trigger or a simple insert command as follow:-
insert into employee values(id_incre.nextval, 'binary','abc@yahoo.com');


Hope this will help you.

Happy trying.


Current Promotions... Post a New Thread anywhere on Web Development Board to earn BRL$ 5 for every thread. Post a new Reply there and earn BRL$ 3 for every reply.
Important - Read before posting Please carefully read the Global Rules and Posting Rules for GPT / Buy - Sell Offers / Link Exchange sections before posting.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-27-2008
Jr. Member
 
Join Date: Apr 2008
Posts: 100
BRL$: 250.09
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 17
webvigor is on a distinguished road
Default Re: Auto increment in Oracle

The best way to have auto increment is to generate it with your own code. You can make a function like NVL(MAX(your field))+1.
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


Current Promotions... Post a New Thread anywhere on Web Development Board to earn BRL$ 5 for every thread. Post a new Reply there and earn BRL$ 3 for every reply.
Important - Read before posting Please carefully read the Global Rules and Posting Rules for GPT / Buy - Sell Offers / Link Exchange sections before posting.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-27-2008
Jr. Member
 
Join Date: Apr 2008
Location: California
Posts: 155
BRL$: 161.29
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 21
binary8383 is on a distinguished road
Default Re: Auto increment in Oracle

hi,

really? How you code that? can show me some sample code? and some explanation as well?

Thanks.


Current Promotions... Post a New Thread anywhere on Web Development Board to earn BRL$ 5 for every thread. Post a new Reply there and earn BRL$ 3 for every reply.
Important - Read before posting Please carefully read the Global Rules and Posting Rules for GPT / Buy - Sell Offers / Link Exchange sections before posting.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-02-2008
New Foot Prints
 
Join Date: Jun 2008
Posts: 29
BRL$: 120.74
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
vaibhav2007 is on a distinguished road
Default Re: Auto increment in Oracle

sry dear i dnt know.............................................. ...............................


Current Promotions... Post a New Thread anywhere on Web Development Board to earn BRL$ 5 for every thread. Post a new Reply there and earn BRL$ 3 for every reply.
Important - Read before posting Please carefully read the Global Rules and Posting Rules for GPT / Buy - Sell Offers / Link Exchange sections before posting.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Start oracle 10g 10.1.3 on 'Redhat Enterprise Linux WS 4'. Rss_Feeds Oracle Database 0 09-20-2007 01:40 PM
Auto Increment Rss_Feeds PHP 0 09-16-2007 12:55 PM
Auto Increment jumping to 2147483647 - mySQL mr_atom mySQL Database 0 09-07-2007 10:26 PM
Is Oracle Logminer still able to use If I use java as a development tool Rss_Feeds Oracle Database 0 07-23-2007 09:25 AM
Comparison between Oracle and Others Rss_Feeds Oracle Database 0 07-09-2007 05:50 AM


 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95