• Post Reply Bookmark Topic Watch Topic
  • New Topic

More detail from SQLException

 
Leslie Chaim
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have this application and using dynamic SQL I often run in to the ORA-00904: invalid column name error.
From my program how can I report more details such as the table and column name, or better yet is there any way I can get the message from the Oracle engine?
Thanks for your help.
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leslie
Have you tried the getErrorCode and the getSQLState methods in the SQLException class? Also, make you are using getMessage too.
 
Leslie Chaim
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave,
I tried it all and it does not give me what I am looking for.
After I catch the SQLException I would like to somehow get the complete Oracle message the same as would be returned when using the OCI oerhms() function call.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!