【问题标题】:ORA-01036 when calling Oracle PL/SQL function with Node.js使用 Node.js 调用 Oracle PL/SQL 函数时出现 ORA-01036
【发布时间】:2020-06-01 19:28:19
【问题描述】:

我正在尝试调用这个 sql 语句

 let sql: string = 'BEGIN :ret := PAC_AGE_WEB.FUN_ATIVA_FAT_ELETRONICA_AEL(:i_cod_un_cons, :i_num_cli, :i_cpu_os, :i_seq_oper_os, :i_seq_ger_os); END;';
  //
  let bindvars: oracledb.BindParameters = {
    i_cod_un_cons: Number.parseFloat(numeroUc),
    i_num_cli: Number.parseFloat(numeroCliente),
    i_cpu_os: codigoCpu.toString(),
    i_seq_oper_os: Number.parseFloat(numeroSeqOper),
    i_seq_ger_os: Number.parseFloat(numeroSeqGer),
    result: { type: oracledb.STRING, dir: oracledb.BIND_OUT, maxSize: 4000 }
  };
  //
  super.execute(sql, bindvars, autoCommit, connection, (errorAtivaFaturaEletronica, resultAtivaFaturaEletronica) => {

我收到以下错误 => 错误:ORA-01036:非法变量名称/编号 errorNum:1036,偏移量:0

变量类型有: i_cod_un_cons:浮动,
i_num_cli:浮动,
i_cpu_os:字符串,
i_seq_oper_os:浮动,
i_seq_ger__os: 浮动

【问题讨论】:

  • 您的 SQL 语句引用了 :ret,但您的 bindvars 有一个名为 result 的属性。

标签: node.js oracle node-oracledb


【解决方案1】:

通过将 ':ret' 更改为 ':result' 解决。

【讨论】:

    猜你喜欢
    • 2012-01-06
    • 2016-06-05
    • 2019-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多