Home » SQL & PL/SQL » SQL & PL/SQL » automatic primarykey
automatic primarykey [message #228038] Fri, 30 March 2007 20:58 Go to next message
SUSAN1
Messages: 36
Registered: March 2007
Member
hi,

how can man count primarykey automtic for each table in a database.

/Susan
Re: automatic primarykey [message #228050 is a reply to message #228038] Sat, 31 March 2007 00:57 Go to previous messageGo to next message
martijn
Messages: 283
Registered: December 2006
Location: Netherlands
Senior Member
I'm not quite sure what you mean.
Do you mean something like auto_increment as in mysql?
Re: automatic primarykey [message #228075 is a reply to message #228050] Sat, 31 March 2007 04:44 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,


or do you want to see the primary key for all the tables in a database.



regards,
Re: automatic primarykey [message #228080 is a reply to message #228075] Sat, 31 March 2007 05:45 Go to previous messageGo to next message
muzahid
Messages: 281
Registered: September 2004
Location: Dhaka, Bangladesh
Senior Member
if u wanna see all primary key then execute the following query

select a.constraint_name, a.table_name, b.COLUMN_NAME
from user_constraints a, user_cons_columns b where a.CONSTRAINT_NAME= b.constraint_name and a.constraint_type ='P'
Re: automatic primarykey [message #228097 is a reply to message #228038] Sat, 31 March 2007 10:45 Go to previous messageGo to next message
SUSAN1
Messages: 36
Registered: March 2007
Member
hi,
what I want is that dont put any id-number for each column, I need it be automatic, like this 1,2,3,4,....
thanks,Susan

[Updated on: Sat, 31 March 2007 10:45]

Report message to a moderator

Re: automatic primarykey [message #228109 is a reply to message #228097] Sat, 31 March 2007 13:50 Go to previous messageGo to next message
Littlefoot
Messages: 20895
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Create a sequence and use it in a database trigger to set this column's value.
Re: automatic primarykey [message #228380 is a reply to message #228038] Mon, 02 April 2007 15:31 Go to previous messageGo to next message
Bill B
Messages: 1484
Registered: December 2004
Senior Member
for a discussion on littlefoot's response, see the following link

http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:924629350003
Re: automatic primarykey [message #228710 is a reply to message #228038] Tue, 03 April 2007 19:41 Go to previous message
SUSAN1
Messages: 36
Registered: March 2007
Member
thanks,
Previous Topic: Call a .net web service from pl/sql where the input parameter is a .net object
Next Topic: Save Output as Excel file and then email the File
Goto Forum:
  


Current Time: Tue Dec 06 00:25:36 CST 2016

Total time taken to generate the page: 0.05579 seconds