What is Referential Integrity in DB2/400?

5 pts.
Tags:
Data quality
DB2/400
What is referential integrity in DB2/400? & What is field reference file in DB2/400?

Answer Wiki

Thanks. We'll let you know when a new response is added.

1. What is referential integrity in DB2/400?
Method to ensure that a value in a “dependent field” in one file exists in the independent field of another file. For example: A method to ensure that the customer number in the order file exists in the customer file. This is often done in programs but it can also be set as database rules using the command

Add Physical File Constraint (ADDPFCST)

What is field reference file in DB2/400?
The field reference file is used as a data dictonary of sorts. It contains field/column definitions (field names, sizes and types, titles and column headings.

So our Field Reference file might contain the definition for customer Number
FDRCUST# 6S 0 TITLE(‘Customer Number’)
COLHDG(‘Customer’ ‘Number’)

Then our OrderHeader file could contain the field definition
ORDCUST# R REFFLD(FDRCUST#/FDRFILE)

And in our Customer File
CUCUST# R REFFLD(FDRCUST#/FDRFILE)

We know the two fields will have the same structure because they inhereted it from the same parent.

Phil

===========================================================

<i>This is often done in programs but it can also be set as database rules using the command …</i>

Technically, if it is done in program logic, it isn’t “referential integrity” — it’s just program logic. The actual question is <i>What is referential integrity in DB2/400?</i>

By using referential integrity supplied by DB2 (by the database itself), program logic doesn’t need to be created. The integrity is enforced even when programming isn’t involved.

DFU, for example, cannot be used to circumvent the integrity. ODBC, interactive SQL, even other business programming cannot change content of files if the change violates the rules of referential integrity that have been applied to the database.

Note that a “field reference file” is essentially unrelated to “referential integrity”. A field reference file is simply a way to supply predictable and standard field definitions when creating new files or adding fields to existing files.

Tom

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb
    Emily It appears the, you removed a web link from Oct 2008. Did it violate rules? Copyright? Was it wrong? Phil
    51,355 pointsBadges:
    report
  • EmNichs
    Hi Phil, I did remove the link because it sent visitors to a 404 error page. If you have a new link, feel free to add it. -Em
    3,250 pointsBadges:
    report
  • philpl1jb
    odd, I got a redirection page to the original article.
    51,355 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following