[BulkInsert] BulkInsert - Null values

Forge Component
Published on 2 Oct by José Galter
18 votes
Published on 2 Oct by José Galter

In OS entities, Null values are passed as 0.

When extension tries to created those records it raises an exception because 0 doesn't exist in referenced entity.

Is there any way work around this?


Hi André,

That is foreign key and some rows have values and others don't? If they are all NULL you can ignore that column.



Yes, some rows have null and other have id references.

We can't ignore this column.

Outsystems entities' Create/CreateOrUpdate actions are handling these null identifiers conversion.

I didn't look to extension code, but who already did it should know if this is a easy one or not.

Hi André,

At the moment there's no way to insert null values using this extension, but that sounds like an useful improvement! I'll add it to my TODO list.


Hi again, André,

I uploaded a new version of BulkInsert that supports inserting NULL values, just on SQL Server. Currently I don't have access to Oracle or MySQL databases to test the same change on those, but if you are using SQL Server you may want to try it out.

The version I uploaded is on OutSystems Platform 11, but I'll upload the OS10 version here, in case someone needs it.


Hi João,

Thanks for the help. We are using v10. If possible, can you provide that version?

The OS10 extension is attached to my previous post.


I wanted to use BulkInsert in a project that is using Oracle database and needed this null for FKs functionality, so I managed to add it to the extension João Abreu shared here.

If anyone's interested it is in the attachment.

P.S. I've fixed a bug in the Oracle function that was causing parameter binding errors for columns that were in the Ignore List


I bug upload fixed BulkInsert when using SQL Server.

If the target item type was Int64 casting was incorrect, please use it if necessary.