Gen application "WHEN permitted value violation" after adding new value
search cancel

Gen application "WHEN permitted value violation" after adding new value

book

Article ID: 138999

calendar_today

Updated On:

Products

Gen Gen - Workstation Toolset

Issue/Introduction

Doing a CREATE on a entity.  One entity attribute is set for 3 permitted values, <space>, S and N.  This is currently working correctly.

Now want to add another permitted value (P) for that attribute.
On the Toolset that was added but after generation/build when users started to test the application it gave an error saying it violates the permitted values set for that attribute. The code logic executes the "WHEN permitted value violation" section.

Using an Oracle database for the application.

Environment

Release : 8.6
Gen Workstation Toolset

Cause

Application database is out of sync with application permitted values.

Resolution

The Oracle DDL generated for the updated attribute is the following.

    <ATTRIBUTE_NAME> CHAR(1) NOT NULL

       CHECK (<ATTRIBUTE_NAME> IN ('P', 'S', 'N', ' ')),

Currently the database has CHECK (<ATTRIBUTE_NAME> IN ('S', 'N', ' ')), i.e. prior to the change to the permitted values in the model.

After adding the permitted value in the model, the physical database also needs to be updated for the new permitted value, CHECK (<ATTRIBUTE_NAME> IN ('P', 'S', 'N', ' ')),.

Additional Information