Skip to Main Content

Programming Languages & Frameworks

Bind parameter value not returning result

user545194Dec 19 2022

Hi,
We are building a rest api with Oracle Database 19c, NodeJS 17.3.1, and oracledb 5.5.0.
There is a minor problem however, please see code.

 ...
const result = await connection.execute(
  `SELECT id, name, address FROM customers
   WHERE id = :id`,
  {
    id:   { type: oracledb.NUMBER, dir: oracledb.BIND_IN, val : 123 }, <-- hard-coded works, but when sending the value via req.params.id nothing is returned
	{ outFormat: oracledb.OUT_FORMAT_OBJECT }
  }
);

console.log(result.rows);
...

Furthermore, we have a lot of business logic in packages and need to call a procedure or function through the rest api. Can someone provide examples.
Thanks!

This post has been answered by mghaffari94 on Feb 18 2023
Jump to Answer
Comments
Post Details
Added on Dec 19 2022
4 comments
132 views