On Thursday, July 16, 2015 at 8:09:16 AM UTC+5:30, ryandesign wrote:
>
>
> On Jul 15, 2015, at 5:03 AM, Nvx Nvx wrote:
>
> > Hi I am very new to node.js.
> > I am unable to insert CSV file to Hana table.
> > Please provide me sample code.
>
> My Sample code is
>
var hdb = require('hdb');
var csv = require("fast-csv");
var client = hdb.createClient({
host : '*********',
port : 30015,
user : '**********',
password : '*******'
});
client.on('error', function (err) {
console.error('Network connection error', err);
});
csv.fromPath("Sampledata.csv")
.on("data", function(data){
// console.log(data[0]);
client.connect(function (err) {
if (err) {
return console.error('Connect error', err);
}
client.prepare('insert into
VIDEOANALYTICS_BRISTOL.STG_IVX_VAN_TRAFFIC_BY_ZONE_PP
values(?,?,?,?,?,?,?,?,?)', function(err, statement){
if (err) {
return console.error('Prepare error:', err);
}
statement.exec([data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]],
function(err, affectedRows) {
if (err) {
return console.error('Exec error:', err);
}
console.log('Array of affected rows:', affectedRows);
});
});
});
})
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/3d3957f1-3aaa-4f99-8dcd-244860ddd297%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.