what is the difference between adding keys & constraints
into a phisical file

Answers were Sorted based on User's Feedback



what is the difference between adding keys & constraints into a phisical file..

Answer / jherie

A key field defines the order in which the records of a PF
member will be sorted (ascending or descending).

On the other hand, constraints, such as UNIQUE, defines
which key field values or records are valid/allowable to be
written into a file. UNIQUE prevents a record with
duplicate key field values to be written into a PF.

Is This Answer Correct ?    25 Yes 0 No

what is the difference between adding keys & constraints into a phisical file..

Answer / sweety joy

during the time of compilation of a file , constrains are
being removed, from the file .but at the time of
compliation keys are not removed in case from pf.

constraints has no affects on members of a pf but keys has
affect on members of pf

Is This Answer Correct ?    2 Yes 2 No

what is the difference between adding keys & constraints into a phisical file..

Answer / kkcode400

ADDING KEY FIELDS TO FILE IT DOES NOT CHECK THE EXISTING
DATA.

BUT CONSTRAINS CHECK THE EXISTING DATA BEFORE ADDING IT.
IF ANY DUPLICATE KEY VALUES ARE THERE OPERATION FAILURE.

Is This Answer Correct ?    1 Yes 1 No

what is the difference between adding keys & constraints into a phisical file..

Answer / kolla ravi

Primary Key - Unique Key - Key are all possible with DDS.
Either a primary or a Unique key as required can be setup
with UNIQUE keyword at file level in DDS.These keys Do not
allow any two records with same keys.
When UNIQUE is not used then FIFO or LIFO may be used. When
nothing is specified it is understood to be FIFO.
All these need Key fields to be specified.

And in addition to this whether primary/unique or just a
key, a key field dictates the order of retrieval of records
when programs read the files.
All these what we spoke above is done through DDS. That
is : all these stay right within the object.

On the other hand it is possible to setup Constraints
externally. These being Primary/Unique/Referetinal/Check.
Once these are defined they can be controlled Externally by
enabling, Disabling or removing them on the files for which
they are defined.In this context it is worth while
understanding various states of constraints and Upd/delete
rules in this context.

Is This Answer Correct ?    0 Yes 1 No

what is the difference between adding keys & constraints into a phisical file..

Answer / praseetha sandeep

when we add keys in a pf it has effect only in that
particular field of pf but when we add constrains to a pf it
has an effect to entire pf

Is This Answer Correct ?    3 Yes 5 No

what is the difference between adding keys & constraints into a phisical file..

Answer / suju

constraint wl effect the particular field,key wl effect the
whole pf.

Is This Answer Correct ?    1 Yes 7 No

Post New Answer

More DB400 Interview Questions

what is use of self join and which cases you will use this join

1 Answers   TCS,


Is it possible to create a logical file whose Physical file is not in same library?

6 Answers  


What is FORMAT keyword and its use?

0 Answers  


How to insert more than one record to a pf at a time?(Bulk insert to a pf)

9 Answers  


YOU CAN DELETE THE RECORD SPACE PERMENANTLY IN PHYSICALFILE THROUGH CL?

4 Answers  






Last statement of any RPG pgm is LR?

5 Answers  


Where the QTEMP library will get created? if the the answer is QSYS, then howcome more than one job can create same library name(QTEMP) in QSYS? what is the uniqueness of QTEMP? For example, run the below command in different workstation WRKOBJ QSYS/QTEMP And take 8 in the option to check the description. both will have different info. so where(which LIB) exactly the QTEMP is stored?

2 Answers  


When we use any keyword like FIFO,LIFO, at file level but whenever we check by runqry we couldn't find answer in FIFO,LIFO,FCFO etc so how we check the answer.

2 Answers  


What is the interactive job?

0 Answers  


How to change the batch job to interactive job?

0 Answers  


Suppose if a physical file is having 1000 records, but i deleted 500 records from it. Here the concern is can the size of the file changes or it remains the same... kindly help me out with thorough xplanation.... Thanks in-advance...

6 Answers   ABC, TCS,


What is the use of member in pf?

0 Answers  


Categories