Hi,

I got some issues while creating bulk insertion in Outsystems, so i've attached my problem in simple example. can anyone please tell me what is the actual syntax, what i did wrong.

Thanks in advance.

There are multiple ways to do it. 

One of them is: 

insert into <table> (name,age)

select 'name1', 'age'

union all
select 'name2','age'

union all

select 'name3','age'

you better check search for it, e.g. https://blogs.oracle.com/oraclemagazine/bulk-processing-with-bulk-collect-and-forall

Hans Dollen wrote:

There are multiple ways to do it. 

One of them is: 

insert into <table> (name,age)

select 'name1', 'age'

union all
select 'name2','age'

union all

select 'name3','age'

you better check search for it, e.g. https://blogs.oracle.com/oraclemagazine/bulk-processing-with-bulk-collect-and-forall


Hi Hans Dollen,

Thanks for your responds,

But i did the same in SQL, its working, but not in OutSystems... Is my way wrong?


Hi Thanigai,

Please google for the right syntax. With "INSERT" with specified values you can only insert a single record. Like Hans wrote, to insert multiple records you need to add a SELECT.

However, if you just want to add some test values to the database, or bootstrap stuff, it's far easier to use the OutSystems bootstrapping functionality by using the "Create Action to Bootstrap data from an Excel" feature.

Hi,

If you want bootstrap stuff you should do as Kilian suggested. If not there is already a Outsystems component that does bulk insert.

Regards,

Marcelo