My query is that I have a CSV file with data in the format as accepted by Salesforce and require to do a BULK sync using BULKApi Version 2. I now need to send this data from sql using SP_OAMethod procedures. Tried to move this data into a DB table with a cursor on this table to concat the data and send it using the procedure, but unfortunately failed due to the string length limitation.
Request you to help me understand if there is a process to directly upload the CSV ( similar way we do in postman by selecting the Binary option and loading the CSV file from the path).
Any solution related to this would be greatly appreciated.
Thanking in advance.
I tried to use the below part of the code, and completed the job on Salesforce but did not process any records -
EXEC @ret = sp_OAMethod @token, 'open', NULL, 'PUT', @url, 'true';
EXEC @ret = sp_OAMethod @token, 'setRequestHeader', NULL, 'Authorization', @authHeader;
EXEC @ret = sp_OAMethod @token, 'setRequestHeader', NULL, 'Content-type', @contentType;
EXEC @ret = sp_OAMethod @token, 'setRequestHeader', NULL, 'content-disposition', "attachment; filename=<path of the csv file with filename.csv>";
I also tried to look for Failed records or successful records using the job id but it did not return anything.