Question
4
Replies
793
Views
Posted: February 13, 2019
Last activity: July 12, 2019
Closed
Solved
Obj-Save or DataSet-Execute
Hi,
I need to save a record in database table from an activity. Which method is better, Obj-Save or DataSet-Execute with Operation="Save"? What are the differences?
Thank you.
***Edited by Moderator Marissa to update platform capability tags****
Hi,
Obj- operations generate their own SQL while RDB- operations rely on the query written in Rule-Connect-SQL instances. Unless there is a need for custom SQL which cannot be solved by Obj- operations, RDB- operations are best avoided. That said, in situations where you need to insert using a select statement or delete multiple records based on a filter criteria, equivalent Obj- operations are currently not available and thus RDB- operations are useful.
Generally all queries should be through the use of Obj methods. If you use RDB methods, you will not be able to access BLOBs. However, RDB methods are necessary if you want to execute stored procedures.
RDB methods would be considered in the below factors
1) stored procedure
2) custom or complex query
3) SQL function
In addition :
1. Obj methods can only be queried upon a single class whereas RDB methods can be helpful in querying along with joins involving more than one class.
2. Obj methods are meant for transactional ease as they have the option of deferred save, rollback etc whereas RDB methods are performed immediately with auto-commit.
Hope this helps.