Kbase P83785: Updating the extent of an array field with a delta.df - will data be lost?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/06/2004 |
|
Status: Unverified
GOAL:
Updating the extent of an array field with a delta.df- will data be lost?
GOAL:
Updating the number of elements in an array field with a delta.df - will data be lost?
FIX:
Most fields in a Progress database represent a single value. However, array fields contain multiple elements. For example, the Mnth-shp field of the time table is an array field. It contains 12 elements, one for every month of the year. The extent is the number of elements contained in an array. If you define a field with an extent greater than 0, that field is an array field.
If the extent of a field is updated (via a delta.df), then existing data in that field will be lost. This is because the delta.df will add the field new.
An example, tested with 9.1D08 -
1. procopy $DLC/empty db1
2. pro db1 > Data Dictionary. Create table1, field1; define field1 as Data-Type integer, Extent: 5
3. pro db1 -p createrec.p
/* createrec.p */
create table1.
update table1.
Input values 1-5.
4. Run disprec.p -
/* disprec.p */
For each table1:
disp table1.
end.
This shows that values 1-5 are there.
5. procopy $DLC/empty db2
6. pro db2 > Data Dictionary. Create table1, field1; define field one as Data-Type integer, Extent: 10
7. Create delta.df between db1 and db2
In delta.df:
RENAME FIELD "field1" OF "table1" TO "Z_field101"
ADD FIELD "field1" OF "table1" AS integer
DESCRIPTION ""
FORMAT "->,>>>,>>9"
FORMAT-SA ?
POSITION 2
INITIAL "0"
INITIAL-SA ?
HELP ""
HELP-SA ""
LABEL ?
LABEL-SA ?
COLUMN-LABEL ?
COLUMN-LABEL-SA ?
CAN-READ "*"
CAN-WRITE "*"
VALEXP ?
VALMSG ""
VALMSG-SA ""
VIEW-AS ?
EXTENT 10
DECIMALS ?
ORDER 10
NULL-ALLOWED
NOT-CASE-SENSITIVE
SQL-WIDTH 220
8. Load the delta.df to db1
9. Run disprec.p on db1 - it shows that there are now no values for the field1.
Thus before updating the extent of an array field, the .d should be dumped for the table affected by the update. Then after the delta.df is applied, reload the data.