Can a BO's Update processing be restricted to only updating columns that have changed?


Can a BO's Update processing be restricted to only updating columns...
Author
Message
Peter Jones
Peter Jones
Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi,

I don't use the DDT and let SF's standard CRUD processing do the heavy lifting. So, when I change a column in a row and save the change every column in the BO is included in the update irrespective of if they have been changed or not. What I would prefer is for the Update command to only include in the Update the column(s) that have changed. I know I can achieve what I want by adding entries in the ExcludeFromUpdate list or using my own stored proc to do the update but I was hoping there may be a 'magic property' somewhere that can turn this facility on.

Cheers, Peter

Replies
Peter Jones
Peter Jones
Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Trent,

Yes, I have seen the Help samples. Maybe my question wasn't clear enough:

1) I don't use the DDT.

2) Does using custom update stored procedures require the use of the DDT?

3) If the DDT isn't needed how do I pass my paramenter values to the update stored proc at run time?

Cheers, Peter

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Peter, I can answer some of your questions:



2)Does using custom update stored procedures require the use of the DDT?




No, it is completely independent of the DDT. The DDT can automagically create the CRUD sprocs for you, but you can create them yourself. I believe many users are doing it this way.



3) If the DDT isn't needed how do I pass my paramenter values to the update stored proc at run time?




You don't. The framework does it for you automatically. The help topic indicates how to structure the signatures for each of the types of sprocs, based on concurrency type. If you setup the sproc correclty and setup the BO to use the sprocs (insert, update and delete), then when you call Save or Delete the indicated sproc is automatically called, passing the current values of the current record in the BO.



Note you can use sprocs for none or as many of the CRUD functions as needed. If a sproc isn't used, then the standard SF generated SQL is used instead.



Hope that helps!
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Greg, Peter

On the same topic, what would be the advantage of using SP for the CRUD?

Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I don't know why Peter is wanting to use sprocs, but here are a couple of common reasons:



1. Security. Often DBAs will disallow any access to tables. All access must be via views and sprocs.



2. Complexity. If you need to do additional processing during a CRUD action, then a sproc is a fast server side option. E.g. a complex trigger needs to be executed when a record is added, complex enough that a normal trigger won't do it.



I'll be interested in other reasons... BigGrin
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Thanks Greg,

So unless there is special need, having the CRUD without SP would be acceptable for any application?

Just want to be on the safe side, since I do have the DDT, but the tables where designed using xCase with not SP for CRUDs.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search