Skip to Main Content

Programming Languages & Frameworks

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

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
659 views