Automate a DB Insert action

Good morning! 

I'm trying to develop an app that requires the automated object insert onto a database.

I can give an example such as: "I want to insert 100 chair objects into my DB". It is a problem if i need to insert 100 chair objects, one by one, into the DB, right?

I have modelled the entity and generated the edit form to insert an object into the database. I created a spinner so that the user can choose the number of objects he wants, but i'm having problems when it comes to use that variable and multiply the insertion action. How can i model / implement this?

I tried already to use for each loops, but this module only iterates a group of objects.

I appreaciate your help in advance! I hope my problem is clear :).

David Cuevas
Not sure what the problem exactly is.

You can use an advanaced query to insert.

And I have no clue why the for-each does not work?

OK :). 


@Statler: The idea was to have a form to insert an object of the chair type. Now imagine that a user must insert 1000 "chairs" on its database. The user must fill that form 1000 times to achieve that. My idea was to create one form, and create an integer field (like a multiplier), so that when the user inputs "1000" on that field, the application launches 1000 insert queries of chair types. I hope my problem is more clear now! :). The for each loop didn't work for me since it has a pre-requisite that is a set of objects. The for-each loop works like an iterator, and in my app, when i'm inserting something, i dont have a record set to iterate.

@Sarkari Naukri, i didn't have code when i posted the question :). And the idea was not to ;).

For both, i already found the solution:

I printed my schema here. The idea was to create a for (not a for-each) statement just by modelling.

Hope i could help  :)
Hi David.

I would say that you can easily get into a big performance problem with that implementation.

I believe that you've limited the number of iterations that can be performed by that screen action but yet, consider having a process that you can wake up on request by the user and perform that loop outside the user request.