[BulkInsert] Problem with BulkInsert Demo app
bulkinsert
Service icon
Forge component by Galter
Application Type
Reactive
Service Studio Version
11.14.16 (Build 60354)

Hi there,

An error message pops up stating: "BulkInsert: Specified cast is not valid". I am only facing this issue when i am on my company's environment. It works perfectly in my environment. 

Error log message:

ImportSpreadsheetFile
 System.Exception: BulkInsert: Specified cast is not valid.
    at Object.s [as getException] (https://osdev.rblbank.com/BulkInsertDemo/scripts/OutSystems.js?eq9LGmzdgJbMq6dbNoVMvQ:2:10241)
    at c.onSuccess (https://osdev.rblbank.com/BulkInsertDemo/scripts/OutSystems.js?eq9LGmzdgJbMq6dbNoVMvQ:3:6706)
    at XMLHttpRequest.<anonymous> (https://osdev.rblbank.com/BulkInsertDemo/scripts/OutSystems.js?eq9LGmzdgJbMq6dbNoVMvQ:3:2122 


My company has their platform version on 11.14.16 where my platform version is the latest 11.53.xx. Could this be an issue? idk. Can anyone please help me with this and let me know why this is happening



Regards

Akash

Hi Akash,

This issue has been seen in past especially for Oracle database. For you is that the case wheherein your compant environment is using Oracle ?

Below is the solution provided in one of the forum the same:

https://www.outsystems.com/forums/discussion/77484/problems-with-bulkinsert-in-oracle-database/

Also there are a couple of existing forums for your reference:

https://www.outsystems.com/forums/discussion/51352/bulk-insert-specified-cast-is-not-valid/

https://www.outsystems.com/forums/discussion/68819/bulkinsert-specified-cast-is-not-valid/

https://www.outsystems.com/forums/discussion/67702/specified-cast-is-not-valid/


Hope this helps.


Thanks & Regards,

Saurabh



Thank you for the reference. In my case I was using an Oracle DB. What a developer suggested was that, in the Oracle DB the ID's are automatically set to autoincrement hence, we need not pass the ID parameter. In the Demo app, the steps i followed in Outsystems were:

-> i created a new structure for the columns of the entity 

->then appended all excel values to the structure 

-> finally i passed the structure to the BulkInsert Server Action.


Note: I referred to the first link and made some changes to the Bulk Insert code, mentioned in the post. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.