invalid name pattern when trying to pass custom oracle type object mapping

后端 未结 3 1135
误落风尘
误落风尘 2020-12-17 04:22

Java spring custom Oracle type as a param and getting following error.

I don\'t understand what does that mean by invalid name pattern ?

Any help app

相关标签:
3条回答
  • 2020-12-17 04:33

    One of 2 things:

    • The oracle user that you are connecting to the database with does not have privileges to execute the stored procedure (unlikely)
    • Your ArrayDescriptor and StructDescriptor should have "mkt_list_tab" and "mkt_list_rec" in uppercase respectively. (more likely)

    Update: This question is similar to yours.

    0 讨论(0)
  • 2020-12-17 04:35

    I Was facing the same issue while calling a Oracle Stored procedure.

    PACKAGE_NAME.PROCEDURE_NAME(?, ?, ?, ?,?, ?, ?, ?, ?)}];

    13:52:24.202 [main] DEBUG o.s.j.s.SQLStateSQLExceptionTranslator - Extracted SQL state class '99' from value '99999' org.springframework.jdbc.UncategorizedSQLException: CallableStatementCallback; uncategorized SQLException for SQL [{call PACKAGE_NAME.PROCEDURE_NAME(?, ?, ?, ?,?, ?, ?, ?, ?)}]; SQL state [99999]; error code [17074]; invalid name pattern: SCHEMA.Type_Param; nested exception is java.sql.SQLException: invalid name pattern: SCHEMA.Type_Param at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1036) at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1070) at org.springframework.jdbc.object.StoredProcedure.execute(StoredProcedure.java:144)

    My procedure was taking 1 Table type input parameter . This parameter was defined at package level scope. So i move this package level scope param to Schema level param and solved the issue.

    PLSQL types created within a package can't be accessed directly from java.

    0 讨论(0)
  • 2020-12-17 04:48

    The oracle user id, you use for your app, doesn't have access to the type MY_SCHEMA.mkt_list_tab.

    Also make sure the below points.

    1) It has to be ALL caps like MY_SCHEMA.MKT_LIST_TAB in your descriptor call.
    2) If you don't use the schema name in code, and your app id is associated with a different schema, better to create a PUBLIC SYNONYM to the type(both the parent and child), and grant EXECUTE privilege to your app id, else, use the schema name in the code.(privileges still needed to be given)

    0 讨论(0)
提交回复
热议问题