‎2007 Feb 22 3:16 AM
Hi frnds
I am having a custom table with primary key field A, this program is used by many programs based on the primary key and they are in production. Now my requirement is I need to add new field to the table which should be unique.
1. what should i do in this case to create a new field?
2. Does creating secondary index will solve my problem?
3. If i create a new field with secondary index with unique key. Can i modify or delete a record based on the secodary index in my new program which i am going to write?. I mean my question is can we modify primary key based on the secondary key?
3 Is there any way other than secondary index?
Thanks in advance
‎2007 Feb 22 6:45 AM
The concept of Primary Key and Secondary Index are different.
->when u r fetching data from from data base , in the select query to make fast retrival we use primary keys in selection if we useing fields other than primary keys fetching time is slow compartively using primary keys , so we will make/create the non-primary key fields as Secondary Index to make fast retrival...
-> primary keys to make unique records in data base.
so u have to decide weather you require extra field (one more field in primary keys) which will not effect another programs...then u can add...
Ramesh.
‎2007 Feb 22 7:48 AM
forget indexes...those are used only for accessing data fast...
nw u hav to add ur new field in the primary key ... for this just add a new field in the primary key are ...but u hav to change ur proogram too accordingly .. it miet give u an error...plz. look into the program too after chaging the table
hope this will help
bbye tc
Ashwani
‎2007 Feb 22 12:47 PM
my question i am having a primary key in the table. now i want to add another field to the table and that should be unique. So based on this unique key value can i modify the primary key value.
for example can i delete the record based on the secondary unique value
and can i modify the record(including primary key value) based on the secondary unique value
‎2007 Feb 22 12:55 PM
oh yes you can
it doesnt even have to be uinque, tho in that case he´s doing your modifications to the first recors matching the requirements.
so yeah it will work but make sure the values in your appended field are really unique.