【问题标题】:Get Output of stored procedure using PutSql in Nifi在 Nifi 中使用 PutSql 获取存储过程的输出
【发布时间】:2022-06-17 21:52:04
【问题描述】:

我必须在 Nifi 中获取 Oracle 存储过程的输出。 我已经使用以下 sql 语句尝试了 PutSql:

声明 VARCHAR2 ;开始 PKG_TEST.P_TEST(1,out);结束;

它工作正常,但它只是执行脚本。 如何获得输出“out”的值? 编辑:我在这里尝试了 Groovy 脚本:

https://community.cloudera.com/t5/Support-Questions/Does-ExecuteSQL-processor-allow-to-execute-stored-procedure/td-p/158922

我收到以下错误:

2022-06-17 13:38:53,353 错误 [Timer-Driven Process Thread-9] o.a.n.p.groovyx.ExecuteGroovyScript ExecuteGroovyScript[id=26ab18f1-3b0c-18cf-d90b-3d5904676458] groovy.lang.MissingMethodException:没有签名方法:Script6a6d0a35$_run_closure1.doCall() 适用于参数类型:(String, String, java.sql.Date, null, String, null, null, String...) 值: [xxxx, xxxx, 2022-05- 30, null, OK, null, null, ...]: groovy.lang.MissingMethodException: 没有方法签名: Script6a6d0a35$_run_closure1.doCall() 适用于参数类型: (String, String, java.sql.Date, null, String, null, null, String...) 值:[xxxx,xxxx, 2022-05-30, null, OK, null, null, ...]

在 org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:255)

所以我有过程的输出,但我得到了错误!

谢谢!

【问题讨论】:

  • 我试过了,但没有任何改变。我以后应该如何使用该变量?谢谢
  • 目前还无法在 nifi for oracle 数据库中获取输出参数。 community.cloudera.com/t5/Support-Questions/… 你可以使用 groovyscript。这里有一些例子:nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/…
  • 一旦你测试接近PKG_TEST.P_TEST - 你可以使用oracle表函数而不是过程并通过结果集返回输出值。
  • 不幸的是它是一个外部数据库,我必须使用那个程序 7. 我认为关于 plsql 的 putsql/exeutesql 的文档不完整......我将使用 GroovyScript thx。
  • @daggett 我编辑了我的问题,你能帮帮我吗?谢谢

标签: oracle stored-procedures groovy apache-nifi plsql-package


猜你喜欢
  • 2021-11-26
  • 1970-01-01
  • 2018-04-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-02-17
  • 2016-02-25
  • 2020-05-22
相关资源
最近更新 更多