I am a Software Engineer from a small city near Munich and are currently working for Sky Germany as a Senior Software Manager and beside this I am owning my own business webCIT.
Feel free to reach out!
A nodejs plugin or mssql based on tedious.
I am a Software Engineer from a small city near Munich and are currently working for Sky Germany as a Senior Software Manager and beside this I am owning my own business webCIT.
Feel free to reach out!
I get this error ๐
q1.execute {"name":"param-not-found","message":"Param 'username' was not found in query or is tried to set twice"}
with this code
var conn = require('node-mssql-connector');
var TYPES = require('tedious').TYPES
sql = new conn( {...});
...
var query = sql.query(
"SELECT staffID, commonName, firstName, surname, email " +
"FROM staff_member " +
"where Username = @username ");
query.param( "username", TYPES.NVarChar, process.env.USERNAME );
query.exec( function( err, rs ){
if (err) return console.log("query.execute "+JSON.stringify(err));
var staffID = rs.result[0].staffid; // why is camelCase flattened? e.g. staffID -> staffid
...
if I comment out the param line I get
q1.execute {"name":"request-error","message":{"name":"RequestError","message":"Must declare the scalar variable \"@username\".","code":"EREQUEST","number":137,"state":2,"class":15,"serverName":"HRSHSQ
L01","procName":"","lineNumber":1}}
Looks like a bug/design error to me
I had to use the string "NVarChar" to make it work
Noel
WARN engine [email protected]: wanted: {"node":"4.2.x"} (current: {"node":"4.4.7","npm":"2.15.9"})
The current error message is good, but I am missing some usefull information about the query that caused the error.
Current error message:
{ name: 'request--params-errors', message: [TypeError: value is out of bounds] }
The error should contain some kind of a stracktrace.
if the connection cannot be established and the driver responds with a "timeout" an error is thrown.
TypeError: Cannot read property 'release' of undefined
at Object.callback (/usr/src/node_modules/node-mssql-connector/lib/mssqlconnector.js:566:21)
at null._onTimeout (/usr/src/node_modules/node-mssql-connector/node_modules/tedious-connection-pool/lib/connection-pool.js:190:32)
at Timer.listOnTimeout (timers.js:92:15)
The read me says to call a stored procedure like
storedprod.( function( err, res ){
I was not able to get that to work, had to call the stored procedure like this:
storedprod.exec( function( err, res ){
May just be a type-o in the read me.
Only load modules which are used in code.
Example:
query = MSSQLClient.query("
SELECT * FROM Products WHERE net_price > @net_price
")
query.param('net_price', 'Money', net_price)
Using a ping method to check the uptime status of the DB.
Just doing a simple SELECT every 5 minutes:
query = MSSQLClient.query("SELECT TOP 1 ID FROM someTable")
query.exec (err, resp) ->
if err
cb(err)
return
if resp.rowcount is 1
cb(null, true)
return
After several hundred of these i get this error.
{ [connection-failed: connection to 192.168.11.101:1433 - failed Error: connect EMFILE]
name: 'connection-failed',
message: 'connection to 192.168.11.101:1433 - failed Error: connect EMFILE',
customError: true }
After this no other network connections (e.g. http requests via request
) can be made as it seems the node process is out of sockets or something.
Some customers said that there is a connection timeout.
Check this via tests with some latency.
are there known issues with node version 4.2.3 (LTS)?
i get errors when using node 4.2.3, i tried these versions:
/usr/build/node_modules/node-mssql-connector/lib/mssqlconnector.js:116
connection.release();
^
TypeError: Cannot read property 'release' of undefined
at Object.callback (/usr/build/node_modules/node-mssql-connector/lib/mssqlconnector.js:116:21)
at null._onTimeout (/usr/build/node_modules/node-mssql-connector/node_modules/tedious-connection-pool/lib/connection-pool.js:193:32)
at Timer.listOnTimeout (timers.js:92:15)
(node) warning: possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at ConnectionPool.addListener (events.js:239:17)
at MSSQLRequestBase.exec (/usr/build/node_modules/node-mssql-connector/lib/mssqlconnector.js:101:27)
at MSSQLRequestBase.exec (/usr/build/node_modules/node-mssql-connector/lib/mssqlconnector.js:3:61)
at Schema.Entity._query (/usr/build/dynasiteNG/server/js/lib/entity.js:72:13)
at Schema._query (/usr/build/dynasiteNG/server/js/lib/entity.js:3:59)
at Schema.Entity._queryGet (/usr/build/dynasiteNG/server/js/lib/entity.js:374:12)
at Schema._queryGet (/usr/build/dynasiteNG/server/js/lib/entity.js:3:59)
at Schema.Materials.get (/usr/build/stylebase/server/js/modules/styles/materials/model.js:514:12)
at Schema.get (/usr/build/stylebase/server/js/modules/styles/materials/model.js:3:59)
at Array.async.auto._accessories (/usr/build/stylebase/server/js/modules/styles/model.js:1087:34)
at listener (/usr/build/node_modules/async/lib/async.js:600:42)
at /usr/build/node_modules/async/lib/async.js:542:17
at _arrayEach (/usr/build/node_modules/async/lib/async.js:85:13)
at Immediate.taskComplete (/usr/build/node_modules/async/lib/async.js:541:13)
at processImmediate [as _immediateCallback] (timers.js:383:17)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.