Forums Register Login

Primary key

+Pie Number of slices to send: Send
Hi,

I am getting the pkgid which is unique from the other application and i am supposed to store it in my database.When the other application requests the info related to Pkgid, i need to send the information from my application.
Do i need create the id as number for Primary key or can i use the same package id as primary key. Which is the best way to approach?

Table
----
Package
-------
id number number
pkg_id varchar2 50


regards
sudha
+Pie Number of slices to send: Send
Don't know, but if the package ID really is unique, why not try it as a primary key?
+Pie Number of slices to send: Send
You can use it.
But remember that,primary keys are used for making relationship between two or more tables.
If you want only uniquness,then you can also make unique key.
As you may be aware,both theses keys have differences.

PK has to be unique and not null.
But UK can be null.



Regards
Baseet Ahmed
Sometimes you feel like a nut. Sometimes you feel like a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 716 times.
Similar Threads
How to assign primary key
to find the primary key of a table
Hibernate many-to-one composite key as foreign key
Subquery in Hibernate 2.0
Retrieving Primary key
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:44:14.