temporary table

Hello everyone

I am grateful for the interest and scope of the following:

I have a recordset of several records of a query from Mysql, until there everything is correct

each record in the recordset contains the following fields:
Code type char, amountIvpp Type Numerico, amountLimp Type Numerico

For each record of the recordset, I need to perform additional calculations and generate other values (fields) like InterestIvpp type Numerico, InterestLimp numeric type, readjustmentIvpp, readjustmentLimp and in turn save them in a Temporary Table both the fields of the recordset and the fields InterestIvpp, InterestLimp, readjustmentIvpp, readjustmentLimp

After processing all records in the recordset, the temporary table must be sent to a listbox.

How to create the temporary table or other type of temporary storage?

Any ideas will be highly appreciated

Raul Juarez Pulache

You might want to think about creating a Data class that mimics your recordset. Each field is a property on the class and you create generic load and save methods that do exactly what you think they do. Then, you treat it just like every other class in Xojo. When you’re done with all the calculations you call save. This way you just need an array (unless you’re talking tens of thousands of records) and you can load the data in the listbox as you see fit.

FWIW, this is pretty close to how we use ActiveRecord. Having a Xojo object (with auto complete) is pretty handy. If you want more information on ActiveRecord and ARGen (the utility to create the classes) go to http://www.bkeeney.com/allproducts/argen/.

Why not throw them to a lisbox directly? Just make those calculated fields as columns of the listbox.

Thanks you Bob Keeny
Thank you Dale Dedory

As Bob comments, I’ve actually had to create a data class, where each field is a class property
and a method for assigning the data to each property.

In the window where I make my query I have created a property (arrays) of Type data type data class
and with this I can work with the data.

Dale’s proposal is also feasible


Raul Juarez Pulache

I’d probably try to write my SQL so that it returns all the values exactly as you need them. But generating your values client side might just be the way to go if you find that easier in Xojo.

I often use Computed Properties in a class instead of class methods.