TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Naidu K
NA
87
20.4k
Calling stored procedure from node js
Mar 1 2021 4:15 AM
I am using express and I am trying to call LoginMember stored procedure from Azure portal. This is my form from, taken from ejs:
<form method=
"post"
action=
"/available-copies"
>
<input type=
"text"
placeholder=
"SSN"
name=
"userssn"
>
<input type=
"password"
placeholder=
"Password"
name=
"userpassword"
>
<input type=
"submit"
value=
"Login"
>
</form>
This is my post request
router.post(
'/available-copies'
,
function
(req, res) {
var
ssn = req.body.userssn;
var
password = req.body.userpassword;
sql.connect(sqlConfig,
function
(err) {
if
(err) console.log(err);
// create Request object
var
request =
new
sql.Request();
// query to the database and execute procedure
request.query(
"exec LoginMember @SSN='"
+ssn+
"', @PASSWORD='"
+password+
"';"
,
function
(err, recordset) {
if
(err) console.log(err);
res.send(recordset);
});
});
sql.close()
});
Thanks in advance
Reply
Answers (
1
)
Node js Unable to connect Pointshare Please help me !!
Node js fetch response