Skip to content
This repository has been archived by the owner on Nov 30, 2018. It is now read-only.

tryggingamidstodin/jt400

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jt400

nodejs jt400 wrapper

Configure

var jt400 = require('jt400').configure({host: 'myhost', user: 'myuser', password: 'xxx'});

SQL query

jt400.query('SELECT FIELD1, FIELD2 FROM FOO WHERE BAR=? AND BAZ=?', [1, 'a'])
.then(function (result) {
	var field1 = result[0].FIELD1;
	...
});

SQL update

jt400.update('update FOO set BAR=? WHERE BAZ=?', [1, 'a'])
.then(function (nUpdated) {
    ...
});

SQL insert

//insert list in one statement
var tableName = 'foo',
    idColumn  = 'fooid',
    rows = [
        {FIELD1: 1, FIELD2: 'a'},
        {FIELD1: 1, FIELD2: 'a'}
    ];
jt400.insertList(tableName, idColumn, rows)
.then(function (listOfGeneratedIds) {
    ...
});

About

nodejs jt400 wrapper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published