gpt4 book ai didi

java - 错误代码[17041];索引::1 处缺少 IN 或 OUT 参数;嵌套异常是 java.sql.SQLException: 在索引::1 处缺少 IN 或 OUT 参数

转载 作者:太空宇宙 更新时间:2023-11-04 13:17:58 33 4
gpt4 key购买 nike

程序参数:

procedure get_user_profile (
i_attuid in ras_user.attuid%type,
i_data_group in data_group_tbl,
o_user_info_tbl out user_info_tbl,
o_service_tbl out service_tbl,
o_user_role_tbl out user_role_tbl,
o_permission_tbl out permission_tbl,
o_work_group_tbl out work_group_tbl,
o_business_domain_tbl out business_domain_tbl,
o_skill_tbl out skill_tbl,
retnum out number
)

Java 代码:

JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
jdbcTemplate.setResultsMapCaseInsensitive(true);

String procedureName = "{call get_user_profile(?,?,?,?,?,?,?,?,?,?)}";
SimpleJdbcCall simpleJdbcCall =
new SimpleJdbcCall(jdbcTemplate).withCatalogName("ras_user_profile_pkg").withProcedureName(procedureName).declareParameters(
new SqlParameter("i_ATTUID", Types.VARCHAR),
new SqlParameter("I_DATA_GROUP", Types.ARRAY),
new SqlOutParameter("O_USER_INFO_TBL", Types.ARRAY),
new SqlOutParameter("O_SERVICE_TBL", Types.ARRAY),
new SqlOutParameter("O_USER_ROLE_TBL", Types.ARRAY),
new SqlOutParameter("O_PERMISSION_TBL", Types.ARRAY),
new SqlOutParameter("O_WORK_GROUP_TBL", Types.ARRAY),
new SqlOutParameter("O_BUSINESS_DOMAIN_TBL", Types.ARRAY),
new SqlOutParameter("O_SKILL_TBL", Types.ARRAY),
new SqlOutParameter("retnum", Types.NUMERIC));

dataGroup = new ArrayList<String>();

Map<String, Object> hm = new HashMap<String, Object>();
hm.put("i_ATTUID", attuid);
hm.put("I_DATA_GROUP", dataGroup.toArray());
hm.put("O_USER_INFO_TBL", Types.ARRAY);
hm.put("O_SERVICE_TBL", Types.ARRAY);
hm.put("O_USER_ROLE_TBL", Types.ARRAY);
hm.put("O_PERMISSION_TBL",Types.ARRAY);
hm.put("O_WORK_GROUP_TBL", Types.ARRAY);
hm.put("O_BUSINESS_DOMAIN_TBL", Types.ARRAY);
hm.put("O_SKILL_TBL", Types.ARRAY);
hm.put("retnum", Types.NUMERIC);

SqlParameterSource in = new MapSqlParameterSource().addValues(hm);

Map simpleJdbcCallResult = simpleJdbcCall.execute(in);

请在这里帮助我(我是新来的两个),为什么我收到此错误:

SQL state [99999]; error code [17041]; Missing IN or OUT parameter at index:: 1; nested exception is java.sql.SQLException: Missing IN or OUT parameter at index:: 1

最佳答案

您应该设置过程的名称,而不是调用过程的指令:

String procedureName = "get_user_profile";

关于java - 错误代码[17041];索引::1 处缺少 IN 或 OUT 参数;嵌套异常是 java.sql.SQLException: 在索引::1 处缺少 IN 或 OUT 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33373474/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com