0

I am working on an application that requires getting data from the stored procedures written in Oracle db. I am using JdbcTemplate of Spring to call the procedure. But calling the procedure results the following exception

Stack trace :-

> org.springframework.jdbc.BadSqlGrammarException:
> CallableStatementCallback; bad SQL grammar [{call
> V2_tl.PKG_TECH_LINKING.p_get_model_list_intl_ctry(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}];
> nested exception is java.sql.SQLSyntaxErrorException: ORA-00942: table
> or view does not exist

Please tell me the solution

neshkeev
  • 6,280
  • 3
  • 26
  • 47
Piyush Sharma
  • 35
  • 1
  • 10
  • What's unclear about "*ORA-00942: table or view does not exist*" –  Aug 27 '14 at 07:53
  • I am able to run that procedure in Oracle, but when calling from code, getting this exception. Statement is quiet clear as it suggest that table i am trying to access does not exist, but it is present.What's the problem – Piyush Sharma Aug 27 '14 at 07:58
  • Sounds as if you are using different users. –  Aug 27 '14 at 08:05
  • Is it related to the access permissions ? U saying this way ? – Piyush Sharma Aug 27 '14 at 08:06
  • if you are trying to call a stored procedure take a look at [this](http://stackoverflow.com/a/9361835/3686755) answer – neshkeev Aug 27 '14 at 08:12
  • I am using CallableStatementCreator for the invocation – Piyush Sharma Aug 27 '14 at 09:23
  • Are you sure you are using the same user in you code that the one you use when you run the procedure in Oracle itself? And are you accessing the table as the same user that owns the table or is it another user that needs the right permissions set? – gvenzl Aug 27 '14 at 09:58
  • Solved ! it was due to the different user being used while calling from code. Just granted the user permission for the tables involved. – Piyush Sharma Aug 27 '14 at 10:25

0 Answers0