Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Tips and Techniques: Qualifying Database Field Names

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tips and Techniques: Qualifying Database Field Names

    ** This thread discusses the article: Tips and Techniques: Qualifying Database Field Names **
    ** This thread discusses the Content article: Tips and Techniques: Qualifying Database Field Names **
    This is a discussion about Tips and Techniques: Qualifying Database Field Names.

    Click here for the article.


  • #2
    Tips and Techniques: Qualifying Database Field Names

    ** This thread discusses the article: Tips and Techniques: Qualifying Database Field Names **
    First lets explain the advantage of PREFIX: lets say You have a complex program with 15 files. Not al files are Your files, so youd do not have control over them. Imagine that a new field was added to one of the files and that field is used also in Your program. An automatic program runs to find all program that use the file and recompiles them. Now Your Program may work unexpected because a new field was added to the file and that same field is used as a variable in Your Program and You were not avare of it by the time You Wrote and tested the program. With Prefix, al that is prevented. Since You gave a prefix to the file, all its fields are rnamed, so ther is no contradiction with other variables. But prefix is not enough. By coincidence one of the rows in the file or in the program may have a name with the same prefix. With Qualified Your program is totaly protected.

    Comment


    • #3
      Tips and Techniques: Qualifying Database Field Names

      ** This thread discusses the article: Tips and Techniques: Qualifying Database Field Names **
      You're right. That is why PREFIX works in conjunction with QUALIFIED on OS/400 V5R1 and later. A value of PREFIX('CM.') implies that you will create a qualified data structure named "CM" thus qualifying the fields of the database file to that data structure; name collision is avoided 100% of the time.

      Comment


      • #4
        Tips and Techniques: Qualifying Database Field Names

        ** This thread discusses the article: Tips and Techniques: Qualifying Database Field Names **
        Using CM. as the prefix in conjuction with a qualified data structure, I am unable to use the qualified fields as data structure subfields in another data structure. 'A qualified name is not allowed in this context.' message is given. Is there a workaround ?

        Comment

        Working...
        X