Skip to content

NodeJs express4-tedious - Stored Procedure for SELECT to return response as JSON #8

@samu7

Description

@samu7

Couldn't show the response in JSON while using a stored procedure.

I'm using express4-tedious to fetch results. It works fine if I use the select query but if I use the same with the stored procedure I don't know how to bind it in JSON.

The response screen is blank as I couldn't get the results.

var tediousExpress = require('express4-tedious');
var TYPES = require('tedious').TYPES;
var router = express.Router();
router.get('/:id', function (req, res) {
    req.sql("exec GETDataOfEmployee @id")
    .param('id', req.params.id, TYPES.VarChar)
    .exec(res)
});

Any suggestions would be of great help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions