[BulkInsert] BulkInsert - Null values

[BulkInsert] BulkInsert - Null values

  
Forge Component
(12)
Published on 10 Nov by João Pedro Abreu
12 votes
Published on 10 Nov by João Pedro Abreu

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?


Thanks

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.

Regards,

Marcelo

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.

Solution

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.

Solution

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.