35
Views
13
Comments
[BulkInsert] Specified cast is not valid
Forge component by João Pedro Abreu
22
Published on 02 Oct 2019
Application Type
Traditional Web


Good afternoon.

 I found a problem that when inserting data from an excel in BulkInsert through the SQL server and it worked perfectly.

 However when I started testing with Oracle I noticed that it gave the error that is in the title without changing any fields and using the same excel sheet.

 I would like to know if there is a problem or if you have to do something different in the Oracle version. 


Thanks in advance.

Rank: #510

Hi Antonio,

Do you know what in what column, or specific cell, is the error occurring?

I'm asking this because "Builk Insert operations use mechanisms that are specific to each DBMS and Application Server, so the performance may vary"

best regard

Rank: #287

Hi Antonio Figueiredo

Please provide more details below.

  1. The detailed error information
  2. The column's data type
  3. SQL
  4. Excel' value for that column 

etc.


Kindly Regards


Rank: #13792

Tanks for reply!


 The error dont give any aditional information about the error than the feedback mensage

 The columns are 4 and they are 2 of text, 1 phone number type, 1 email type

I will send you some prints...


I try already to put everything text or only 1 field but do the same error...

 

Screenshot12.png

Rank: #510

Antonio,

Have you tried to change the phone number column values? Lets say, for small ones.

Rank: #13792

Yes i try. I put all text as well and do the same error. Then i try to put only 1 value in text and do the same. But in SQL Server work perfect only in Oracle that not.


Rank: #510
Rank: #13792

I tried with and without empty cells but if i put everything empty dont create a regist in Database...

Rank: #510

And without them? In other words, with a LastName for "Flo".

Rank: #13792

Ok,
Basically this is a resume.

If  put empty values in everything dont create -> give an error

If  put some values nulls -> give error but in SQL Server create with a empty cell

If put all values correct -> give error but in SQL Server works fine

If put all values in text and in entity atributes too -> give error but in SQL Server works fine


Error given all the time excepts when i dont put an excel file or its a file completely empty. -> "Specified cast is not valid "


Rank: #510

Look at the thread below. Maybe it could be helpful.

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

Rank: #510

I don't know that is your OutSystems version, but there is another thread that says that BuilkInsert is no longer maintaining for the 10th version.

mvp_badge
MVP
Rank: #15

Hi Antonio,

Can you let us know the structure you are using to convert from excel with the respective data types and also the data types you are using on the outsystems database you are trying to insert this records.

Regards,

Marcelo

Rank: #13792

Ok i send you an example to show how it works...

BulkInsertDemo.oap