Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
connection.on('connect', function(err) {
var request = new Request('countChar',
function(err) {
if (err) {
console.log(err);
}
connection.close();
});
request.addParameter('inputVal', TYPES.VarChar, 'hello world');
request.addOutputParameter('outputCount', TYPES.Int);
request.on('returnValue', function(paramName, value, metadata) {
console.log(paramName + ' : ' + value);
});
connection.callProcedure(request);
});
return new Promise((resolve, reject) => {
const request = new Request(query, err => {
if (err) {
reject(err)
} else {
resolve()
}
connection.close()
})
request.addParameter('body', TYPES.VarChar, body)
request.addParameter('target', TYPES.VarChar, target)
connection.execSql(request)
})
}
.executeProc("Faq_Update", sqlRequest => {
sqlRequest.addParameter("faqId", TYPES.Int, faq.faqId);
sqlRequest.addParameter("question", TYPES.VarChar, faq.question, {
length: 250
});
sqlRequest.addParameter("answer", TYPES.VarChar, faq.answer, {
length: 500
});
})
.then(response => {
return mssql.executeProc("CalculationRule_Update", sqlRequest => {
sqlRequest.addParameter("code", TYPES.NVarChar, item.code, {
length: 50
});
sqlRequest.addParameter("name", TYPES.NVarChar, item.name, {
length: 100
});
sqlRequest.addParameter("category", TYPES.VarChar, item.category, {
length: 20
});
sqlRequest.addParameter("dataType", TYPES.VarChar, item.dataType, {
length: 20
});
sqlRequest.addParameter("units", TYPES.VarChar, item.units, {
length: 50
});
sqlRequest.addParameter(
"value",
TYPES.VarChar,
JSON.stringify(item.value),
{
length: 200
}
);
return new Promise((resolve, reject) => {
const request = new Request(query, err => {
if (err) {
reject(err)
} else {
resolve()
}
connection.close()
})
request.addParameter('body', TYPES.VarChar, body)
request.addParameter('target', TYPES.VarChar, target)
connection.execSql(request)
})
}
.executeProc("CalculationRule_Insert", sqlRequest => {
sqlRequest.addParameter("calculationId", TYPES.Int, item.calculationId);
sqlRequest.addParameter("code", TYPES.NVarChar, item.code, {
length: 50
});
sqlRequest.addParameter("name", TYPES.NVarChar, item.name, {
length: 100
});
sqlRequest.addParameter("category", TYPES.VarChar, item.category, {
length: 20
});
sqlRequest.addParameter("dataType", TYPES.VarChar, item.dataType, {
length: 20
});
sqlRequest.addParameter("units", TYPES.VarChar, item.units, {
length: 50
});
sqlRequest.addParameter(
"value",
TYPES.VarChar,
JSON.stringify(item.value),
{
length: 200
}
);
sqlRequest.addParameter(
"functionBody",
TYPES.NVarChar,
.executeProc("Faq_Update", sqlRequest => {
sqlRequest.addParameter("faqId", TYPES.Int, faq.faqId);
sqlRequest.addParameter("question", TYPES.VarChar, faq.question, {
length: 250
});
sqlRequest.addParameter("answer", TYPES.VarChar, faq.answer, {
length: 500
});
})
.then(response => {
getTediousType(type) {
switch (type) {
case 'varchar':
return TYPES.VarChar;
}
}
}