Welcome Guest! Log in
×

Notice

The forum is in read only mode.
Due to some maintenance operations, stambia.org will be switched to read-only mode during the 13th November. It will be possible to read and download, but impossible to post on the forums or create new accounts. For any question please contact the support team.

Topic-icon Question CSV Bulk insert issue

More
28 Sep 2016 07:52 #1 by Prashant.Sangle
Prashant.Sangle created the topic: CSV Bulk insert issue
Hi,

I have CSV file which I want to insert into db

If I try with Action Process LOAD File to Mssql (with BULK) template it gives me below error
com.microsoft.sqlserver.jdbc.SQLServerException: Cannot bulk load. Invalid number of columns in the format file "e:\devl\IMS/SSIM07L.fmt".

If i try with Action Process LOAD File to Rdbms template then It work fine.

I am attaching screen shot of error and also sample file.
Please help me to resolve error.

Let me know if any other details required.

Regards,
Prashant
Attachments:
More
28 Sep 2016 14:48 #2 by Nikolay
Nikolay replied the topic: CSV Bulk insert issue
Template Action Process LOAD File to Rdbms does not use Bulk Load. It uses Select from the source and insert to the destination
Probably you have an errors at the metadata. Check if you used whitespaces in the names of the fields.
Moreover you can compare fmt file that Stambia generates with fmt file of bcp out.
More
28 Sep 2016 16:04 #3 by Prashant.Sangle
Prashant.Sangle replied the topic: CSV Bulk insert issue
Hi,

To test my mapping is correct or not, I am using Template Action Process LOAD File to Rdbms.
For bulk load i am using Template Action Process LOAD File to Mssql (with BULK) template which is giving me error.

also If there is errors at the metadata then how could my mapping executed successfully when i executed my mapping with Template Action Process LOAD File to Rdbms. and I have check there is no whitespace in the names of the fields.

Also your suggestion for compare fmt file that Stambia generates with fmt file of bcp out, I will check and get back to you.

Thanks for help.

Regards,
Prashant
More
29 Sep 2016 16:06 - 29 Sep 2016 16:06 #4 by Thomas BLETON
Thomas BLETON replied the topic: CSV Bulk insert issue

Prashant.Sangle wrote: [...]If there is errors at the metadata then how could my mapping executed successfully when i executed my mapping with Template Action Process LOAD File to Rdbms. [...]


Because these two templates (File To Rdbms & File to Mssql (with BULK)) use different technologies to load the data (Jdbc vs. Mssql's BULK tool). That's why there can be different behaviors ;)

Prashant.Sangle wrote: [...]Also your suggestion for compare fmt file that Stambia generates with fmt file of bcp out, I will check and get back to you.[...]

This is a good practice when having issues with BULK-like tools:
- try loading the file out of Stambia, using directly the tools
- compare the working FMT file with Stambia-generated to see the differences
- adjust your Stambia metadata & template options to obtain the desired FMT file.
Last Edit: 29 Sep 2016 16:06 by Thomas BLETON.