Funny Behavior with Stored Procedure [message #407846] |
Thu, 11 June 2009 21:40 |
russray
Messages: 9 Registered: May 2005
|
Junior Member |
|
|
Please excuse me as I try to walk my way through this issue I am facing involving a stored procedure in Oracle 10g.
My issue is when I call the store procedure within SQL Developer, all is right with the world. The parameters get passed in correctly and the data is loaded in the tables correctly..... When I set the serverouput to on, I can see the parameters being passed correctly.
Next I back the call to the store procedure to a Java program. Here, the data is not right and I get a unique constraint error. I think the store procedure is correct but I can prove it.
Suggestion?
Russ
|
|
|
|
|
|
Re: Funny Behavior with Stored Procedure [message #407923 is a reply to message #407918] |
Fri, 12 June 2009 06:29 |
russray
Messages: 9 Registered: May 2005
|
Junior Member |
|
|
Oh..... You mean use the JDBC Driver with additional logging and set the trace to true...
Thanks I will try this.....
There is also tracing in Oracle...... Will this help me any?
Excllent suggestions..... thank you.....
Russ
|
|
|
|
Re: Funny Behavior with Stored Procedure [message #416176 is a reply to message #407924] |
Fri, 31 July 2009 00:22 |
|
Kevin Meade
Messages: 2103 Registered: December 1999 Location: Connecticut USA
|
Senior Member |
|
|
to prove that your procedure is good, do two things:
1) put some auditing of some kind in it so that it can report to you somehow what the values of the paramters it received were. Using whatever you want, dbms_output, autonomous transaction, whatever works for you. Indeed, you should always think about some kind of audit routine for you code.
2) execute using sqlplus (or if you are in 11g where there is no sqlplus, download 10g sqllplus and use that).
Correct results will prove the value of the procedure.
From there run from java still letting the procedure audit its incomming parameters. Then you will know if it is receiving the same inputs.
As was said before, my money is on "OPERATOR ERROR".
1) you are not passing the values from the java program that you think you are (might be wrong variables, wrong order, datatype issue).
2) you are not calling the same procedure because you have a second copy of it somewhere else and your java call is using that one.
Good luck, Kevin
|
|
|