Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
4 replies
Subscribers
7 subscribers
Views
1455 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Hi, We have this requirement (simplified version): There are 2 tables
senthilar
over 11 years ago
Hi,
We have this requirement (simplified version):
There are 2 tables - Employee, EmployeeTasks. The EmployeeTasks table has a reference to Employee table (employeeId column) and it can have several rows for the same employee. There are columns in EmployeeTasks table which are NON-NULLABLE. Our process produces employee object first and the employee task object would be produced after several hours (or maybe days).
What we need is, we should insert into the Employee table as soon as we have employee object without waiting for employee task object(s). The EmployeeTask can be inserted as and when we get the object populated by our process.
To bring the proper Foreign key constraint between the 2 tables, we added the employeeTask CDT inside the employee CDT. This way the tables get created properly with correct constraints. But, when we try to insert employee (by using Write To DataStore smart service and mapping employeeCDT), we get "cannot insert nu...
OriginalPostID-102760
OriginalPostID-102760
Discussion posts and replies are publicly visible
Parents
0
senthilar
over 11 years ago
...ll into xyz (non-nullable) column in EmployeeTask" error.
So, we deleted CDTs and recreated this way - EmployeeCDT doesn't have reference to EmployeeTaskCDT, but EmployeeTaskCDT contains a field called employeeId which is of type EmployeeCDT. This way, again, the DB constrains are established correctly, and we are able to insert into Employee table without facing problem. But when we insert into EmployeeTask we face problem. If we just populate the employeeId in the EmployeeCDT within the EmployeeTaskCDT, all data is getting wiped off in the row in Employee table. Of course we could populate all the fields in EmployeeCDT within the EmployeeTaskCDT, but then everytime we insert into EmployeeTask we would unnecessarily be updating Employee.
This left us wondering what would be the right way to solve the issue and also meet our requirement. Pls let know your thoughts.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
senthilar
over 11 years ago
...ll into xyz (non-nullable) column in EmployeeTask" error.
So, we deleted CDTs and recreated this way - EmployeeCDT doesn't have reference to EmployeeTaskCDT, but EmployeeTaskCDT contains a field called employeeId which is of type EmployeeCDT. This way, again, the DB constrains are established correctly, and we are able to insert into Employee table without facing problem. But when we insert into EmployeeTask we face problem. If we just populate the employeeId in the EmployeeCDT within the EmployeeTaskCDT, all data is getting wiped off in the row in Employee table. Of course we could populate all the fields in EmployeeCDT within the EmployeeTaskCDT, but then everytime we insert into EmployeeTask we would unnecessarily be updating Employee.
This left us wondering what would be the right way to solve the issue and also meet our requirement. Pls let know your thoughts.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data