How to discharge quickly values on unstored field

Questions and answers regarding general SQL and backend databases

How to discharge quickly values on unstored field

Postby logicimpresa » Mon Jul 13, 2015 7:18 pm

Hi to all,
I have a simple question: I need to clear quickly some values stored into a unstored field.
I populated the foundset with some values and I want, quickly, resetting the values to null
The tables are very large and do not want to use iterators and for loops.
Thank you in advance.
Gianluca Zanini
Logic Impresa - Italy
SAN Partner
Best BAP development 2014
Eager Beaver 2013
Servoy Valued Professional 2012
User avatar
logicimpresa
 
Posts: 65
Joined: Sun May 01, 2011 3:58 pm
Location: Bernate Ticino (MI) - Italy

Re: How to discharge quickly values on unstored field

Postby ROCLASI » Mon Jul 13, 2015 7:50 pm

Hi Gianluca,

I would keep track of the affected JSRecords in a (form) global variable (Array).
This way you have direct access to the records even if they are no longer in your current foundset.
You then loop through your array and reset the values.

Hope this helps.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: How to discharge quickly values on unstored field

Postby logicimpresa » Wed Jul 15, 2015 12:51 pm

Hi Robert,
I would not want to use this way, because the foundset could also be of about 300,000 records.
I tried to clean the foundset with "foundset.clear" but the values on the unstored fields remains.
There is no way to reset the unstored fields without process the records one by one?

Thanks
Gianluca Zanini
Logic Impresa - Italy
SAN Partner
Best BAP development 2014
Eager Beaver 2013
Servoy Valued Professional 2012
User avatar
logicimpresa
 
Posts: 65
Joined: Sun May 01, 2011 3:58 pm
Location: Bernate Ticino (MI) - Italy

Re: How to discharge quickly values on unstored field

Postby ROCLASI » Wed Jul 15, 2015 1:10 pm

Hi Gianluca,

300K is a lot :)
But do remember you are only storing a reference to the JSRecord. And it seems they stay in memory/cache anyway so I wonder if it adds a lot more weight to it.
In any case using the Array approach will make your looping through it a lot more efficient than looping through the foundset because you will only target the records that have in-mem data.

As for an easier way. Perhaps Johan or Rob can tell us more.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: How to discharge quickly values on unstored field

Postby logicimpresa » Wed Jul 15, 2015 1:50 pm

Hi Robert,

I know that the approach "in-mem" is a bit heavy, but unfortunately I have to load 'on the fly' of information that other users should not see.
I'll try to do as thou hast advised (pending advice from Johan or Rob :) )

Thanks a lot
Gianluca Zanini
Logic Impresa - Italy
SAN Partner
Best BAP development 2014
Eager Beaver 2013
Servoy Valued Professional 2012
User avatar
logicimpresa
 
Posts: 65
Joined: Sun May 01, 2011 3:58 pm
Location: Bernate Ticino (MI) - Italy


Return to SQL Databases

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron