0

I have a query:

const getRunsByProjectTable = {
  text: 'Select pvt(); Execute pvtstmt;'
} ;
const getRunsByProjectTable = (req, res) => {
    pool.query(queries.getRunsByProjectTable, (error, results) => {
        if (error) throw error;
        res.status(200).json(results.rows);
    })
}

It does not return anything but on pgAdmin, I am getting the desired table. Does anyone know what the problem may be?

3
  • Does this answer your question? Execute multiple queries in a single statement using postgres and node js Commented Jul 30, 2022 at 0:24
  • For some reason, those solutions do not work for me. Commented Jul 30, 2022 at 0:33
  • it could be the second statement. i am guessing the first make the statement in a fucntion and the second executes it. It will be better to put both on an procedure and run the procedure. Commented Jul 30, 2022 at 1:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.