CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Primary KEY

Print topic Send  topic

Author Message
Nix Neon
Posted: 03/11/2003, 11:44 AM

I have a database on my AS400 called employee file. I can view this, edit, add to it. With the exception of the primary key. How do I allow for the updating or adding of the primary key?
RonB
Posted: 03/12/2003, 4:42 AM

Primary keys seldom change. They are often used in other tables as reference to a record. If you'd change the primary key in table a you run the risc that in table b the reference to a record in table a is lost.You would create the nightmare of every DBA... data inconsistency!!

CCS almost always handles the primary key and often the database used has some mechanism for making sure the key stays unique(autoincrement etc.

If you have to fool around with the primary key I'd stick to inserts and forget updating unless you are prepared to do a lot of event coding making sure the changed value for the key gets changed in all tables that hold this key as a reference. Even with inserts it's good practice to do a check when the primary key is not a auto-increment field or doesn't use a sequence(oracle) to generate the key.

If you include the primary key in the record grid you can change or insert new ones.

Ron

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.