[BulkInsert]  BulkInsert : Specified cast is not valid Oracle db
Service icon
Forge component by Galter

Hi ,

while trying to use bulk insert extension, facing below issue :

Received the below message as exception.

[1] Bulk Insert: Specified cast is not valid. 

[2] Specified cast is not valid.

I get data from API then I try to match the attributes from API to Local List of Entity type.

Have set the input of bulk insert after converting to object.

All attributes belong to same datatype I have verified it , but still getting the above mentioned issue.

Entity defined in ORACLE.



Hi @Vijay R 

In the context of using the Bulk Insert extension in OutSystems, this error could be related to how data types are being mapped from the API response to the local list of entity type, or how they are being converted into objects for the bulk insert.

Here are a few steps you can take to troubleshoot and resolve this issue:

Data Type Compatibility: Double-check that the data types of attributes from the API response match exactly with the data types of the corresponding attributes in your local list of entity type. Even a small difference, such as using a different numeric data type (e.g., decimal vs. integer), can lead to casting issues.

Type Conversions: If there's any conversion happening during the mapping process (from API response to local entity), ensure that the conversion logic is correct and that the target data type can handle the conversion. Incorrect type conversions could trigger the "Specified cast is not valid" error.

Object Conversion: When converting data to objects for bulk insert, make sure that the object conversion is being done correctly. Check if any type conversions are happening during this step and verify their correctness.

Nullable Attributes: If any of the attributes in your local entity are nullable, ensure that the corresponding API attributes are also nullable. Mismatches in nullability can lead to casting errors.

Check for Invalid Data: Carefully inspect the data coming from the API for any unexpected values or formats that might cause casting issues.

Hope It helps 



Hi Arun,

Thanks for the response, 

I have checked all the scenarios you have mentioned. no such issues.

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