Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Storing Draft records in the table

Mrinal86Oct 20 2016 — edited Oct 21 2016

Hi All,

I have set of tables which capture the data from UI Forms whenever user presses 'Submit' button in UI screen.

Recently, UI screen has added new functionality as 'Save As Draft" which enables end-user to partially enter some data and save it as a "Draft" record. Later, the user can retrieve the same Draft record and modify it further N no. of times. Whenever, the user clicks the "Submit" button, it will be stored as "Active" record.

For the "Save as Draft" functionality, we need not check for any NOT NULL fields and should persist whatever data is provided in the UI screen to the table.

I have thought about putting DEFAULT values for NOT NULL fields in the table. However, some of the columns in the table are foreign keys of other parent tables. Having DEFAULT values in those foreign key columns will break referential integrity unless i create dummy records in the parent table with values same as DEFAULT values.

I don't want to adopt this approach of putting dummy records in the parent table for satisfying the referential constraint for the "Save As Draft" records. Is there any alternative approach/design by which i can implement the above "Save As Draft" functionality in the Database tables ?

P.S.: I don't want separate tables for storing Draft records as i need to implement this functionality for around 20 tables and i am not keen on creating another 20 tables for storing only the draft records.

Any help in this regard would be much appreciated.

Thanks,

Mrinal

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 18 2016
Added on Oct 20 2016
4 comments
1,189 views