问题描述
我想从 Java 代码中调用包 ult_pkg
中的这个过程 get_data_Q1
并显示输出:
I want to call this procedure get_data_Q1
in the package ult_pkg
from Java code and display the output:
推荐答案
这不可能,参见 访问 PL/SQL 索引表:
Oracle JDBC 不支持 RAW、DATE 和 PL/SQL RECORD 作为元素类型.
Oracle JDBC does not support RAW, DATE, and PL/SQL RECORD as element types.
我可能会像这样使用自定义(全局,而不是包)对象类型:
I'd probably use a custom (global, not package) object type like so:
引用包中的类型表(t_all_records 而不是 tt_all_tab)并像这样填充
reference the table of type in your package (t_all_records instead of tt_all_tab) and fill it like so
结果可以像这样从java中使用:
Result will be useable from java like so:
但最终,当您可以在简单的 sql 语句中将查询用作准备好的语句时,是否值得付出努力是值得怀疑的……
But in the end, it's questionable if it's worth the effort when you could use your query in a plain sql statement as a prepared statement…
这篇关于如何从 Java 类中调用带有 out 参数作为表类型的过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!