I have instantiated a Db2 Warehouse on IBM Cloud and created a table in that Db2 instance. Now I want to load that table with data that resides in a local *.csv file.
I am able to create a bearer token:
curl -X POST "https://dashdb-entry-yp-lon02-01.services.eu-gb.bluemix.net/dashdb-api/v2/auth" -H "accept: application/json" -H "content-type: application/json" -d "{ \"userid\": \"dash14096\", \"password\": \"************\"}"
Also, I can fetch the table meta information:
curl -X GET "https://dashdb-entry-yp-lon02-01.services.eu-gb.bluemix.net/dashdb-api/v2/schemas/DASH14096/tables/MYTABLE" -H "accept: application/json" -H "Authorization: Bearer eyJ0eXAiOiJKV1Q..."
I have got local file "mydata.csv" with the following content:
1;ONE
2;TWO
3;THREE
I am actually able to load that data using the V1 REST interface:
curl --user "dash14096:************" -H "Content-Type: multipart/form-data" -X POST -F loadFile1=@".\mydata.csv" "https://dashdb-entry-yp-lon02-01.services.eu-gb.bluemix.net/dashdb-api/load/local/del/DASH14096.MYTABLE?hasHeaderRow=false&delimiter=;&loadAction=REPLACE"
BUT: How can I load the data into my Db2 Warehouse table using the V2 or V3 REST interface? In particular, if I need to use the /load_jobs function, how to build a multipart REST request when the body must hold the load options?
Any hint is appreciated. Thanks!!