Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[BUG] callProcedure() does not put the return value in the results object

未关闭
#367 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
领域
api, backend

调研方向

从 callProcedure() 入口点开始,针对 IBM i ODBC 设置运行提供的 Node.js 复现。跟踪存储过程返回值与输出参数一同被处理的方式,并考虑当 results 对象的 return 属性包含 42 而 parameters 包含 "goodbye" 时所执行的工作。

由索引模型根据 Issue 内容生成。

描述

confirmed

Describe your system

  • odbc Package Version: 2.4.8
  • unixODBC version: 2.3.9-1
  • ODBC Driver: IBM i Access ODBC Driver 1.1.0.27-0
  • Database Name: DB2 for i
  • Database Version: IBM i 7.4
  • Database OS: IBM i 7.4
  • Node.js Version: v18.18.2
  • Node.js OS: IBM i 7.4

Describe the bug
When calling stored procedures with callProcedure(), the return value is not populated into the results object. Instead it's just undefined.

Expected behavior
The results object property "return" should have the return value from the stored procedure.

Code to reproduce
SQL to create an example stored procedure:

CREATE OR REPLACE PROCEDURE NODEODBC.test_return (
  INOUT message       varchar(128)
)
LANGUAGE SQL
BEGIN
  set message = 'goodbye';
  return 42;
END;

NodeJS code:

import odbc from 'odbc';

let conn = await odbc.connect('DSN=*LOCAL');

let parameters = ['hi there'];
let result = await conn.callProcedure(null, 'NODEODBC', 'TEST_RETURN', parameters);

console.log(result);

Results from NodeJS:

node stored-proc-return-value.js
[
  statement: '{ CALL NODEODBC.TEST_RETURN (?) }',
  parameters: [ 'goodbye' ],
  return: undefined,
  count: 0,
  columns: []
]

Results from ACS Run SQL scripts:

call NODEODBC.test_return('hi there');

[ 02/06/2024, 11:20:41 AM ]  Run Selected...
call NODEODBC.test_return('hi there')
Return Code = 42
Output Parameter #1 (MESSAGE) = goodbye
Statement ran successfully   (2 ms)
主要语言
JavaScript
星标
159
派生
92
平均合并
5 小时 59 分钟
30 天内合并 PR
3

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

IBM/node-odbc 的其他 Issue

查看 IBM/node-odbc 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。