Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to log the raw SQL from Oracle occi C++ api?

One of our customers is complaining our application is not working. Their reasoning is that our sql function call to their Oracle database is not getting the "expected" result. Sometime, it should failed but our application get success from their database. It's really frustrating because it's their database and we cannot do any test on it.

We are using the C++ Oracle OCCI API. Is there anyway we can log the raw sql from our end? That will be very helpful and we can ship the script to them and let them debug in their system to figure out the problem.

Thanks in advance.

like image 332
savanna Avatar asked Apr 06 '10 21:04

savanna


1 Answers

I assume that you are issuing just a SQL statement, since you say that you want to see the 'raw SQL from your end'. The best thing, then, is to get the database trace, as has been suggested.

What I want to point out is that even if your SQL returns the expected result in a test database, the same SQL may return an unexpected result in another database because the data may be different: the data may be corrupted, indexes may exist or may not exist, constraints may be defined or not, etc. Definitely, you need to get the trace from the database to be able to move forward.

like image 84
JorgeLarre Avatar answered Nov 15 '22 09:11

JorgeLarre