View previous topic :: View next topic
|
Author |
Message |
mfguy
New User
Joined: 31 Jul 2003 Posts: 4
|
|
|
|
Hi All,
would anyone please give me the query for the below requirements
1.Need to change all the nullable values for column department with value 'abc' for a table.Here the column department is nullable.
2.I have a table with three columns a1,a2,a3.Here a1 is the primary key.The requirement is such that I have to add one more column a4 to this table and make this column a4 as the primary key instead of a1.How should I proceed with this requirement.Please give me the steps.
All sorts of help appreciated.
Thanks
mfguy |
|
Back to top |
|
|
mdtendulkar
Active User
Joined: 29 Jul 2003 Posts: 237 Location: USA
|
|
|
|
Hello mfguy,
1)
UPDATE DEPTTBL SET DEPARTMENT = 'ABC' WHERE DEPARTMENT IS NULL
2)
follow the procedure below:
Code: |
a) drop the primary key constraint
b) add a column
c) based on conditions, make each row value unique and then add the
primary key constraint.
|
This is possible only when the data added to the column is distinct.
Plz correct me if i am wrong anywhere,
Hope this will help you.
Regards
Mayuresh Tendulkar |
|
Back to top |
|
|
mcmillan
Site Admin
Joined: 18 May 2003 Posts: 1210 Location: India
|
|
|
|
Dear tendulkar,
You are not wrong... Good work. Keep it up. But you may need to create an UNIQUE Index on column A4 before adding the Primary key. (if you are not using a Schema Processor). |
|
Back to top |
|
|
|