lurcher / unixODBC

The unixODBC Project goals are to develop and promote unixODBC to be the definitive standard for ODBC on non MS Windows platforms.
GNU Lesser General Public License v2.1
94 stars 51 forks source link

Failing trigger does not report an error to unixODBC #169

Open chunter2 opened 2 months ago

chunter2 commented 2 months ago

I'm using unixODBC in my c++ application to talk to an Oracle 19c database. I've got things working but have stumbled across an issue. I've got a table that has a trigger on it when a specific column is updated. The trigger has a coding issue and currently fails. This needs to be fixed. The issue is I don't get any errors when calling the update to the table back to my application. The table fails to update in the database but my application thinks everything is fine. I'm running on almalinux and using the unixODBC.x86_64 2.3.7-1.el8 package. Any thoughts?

Thanks

lurcher commented 2 months ago

On 17/04/2024 11:16, chunter2 wrote:

I'm using unixODBC in my c++ application to talk to an Oracle 19c database. I've got things working but have stumbled across an issue. I've got a table that has a trigger on it when a specific column is updated. The trigger has a coding issue and currently fails. This needs to be fixed. The issue is I don't get any errors when calling the update to the table back to my application. The table fails to update in the database but my application thinks everything is fine. I'm running on almalinux and using the unixODBC.x86_64 2.3.7-1.el8 package. Any thoughts?

Thanks

— Reply to this email directly, view it on GitHub https://github.com/lurcher/unixODBC/issues/169, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYK62L3BKQYG3XHZNS73Y3Y5ZDYHAVCNFSM6AAAAABGLAHXFSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2DOOJSGU2TAMY. You are receiving this because you are subscribed to this thread.Message ID: @.***>

I assume the driver is not reporting it to unixODBC, so it can't report to your application. At first sight, sounds like a issue with the driver.

chunter2 commented 2 months ago

When you say driver, do you mean the Oracle client driver? I'm using Oracle's client driver and Oracle's ODBC package for linux. If I run the same update to run the trigger in sqlplus which uses the Oracle client driver I get the appropriate error.

lurcher commented 2 months ago

On 17/04/2024 12:28, chunter2 wrote:

When you say driver, do you mean the Oracle client driver? I'm using Oracle's client driver and Oracle's ODBC package for linux. If I run the same update to run the trigger in sqlplus which uses the Oracle client driver I get the appropriate error.

No, I mean the Oracle ODBC Driver, which I assume is part of "Oracle's ODBC package for linux". AFAIK, sqlplus uses the OCI client library not the ODBC one.

chunter2 commented 2 months ago

I believe you're right with OCI and sqlplus. So you're suggesting it's an issue with the Oracle ODBC Driver? Any suggestions on how to test that theory?

lurcher commented 2 months ago

On 17/04/2024 14:23, chunter2 wrote:

I believe you're right with OCI and sqlplus. So you're suggesting it's an issue with the Oracle ODBC Driver? Any suggestions on how to test that theory?

Well, the fact that unixODBC is not reporting a error suggests that the driver is not returning one. You could add some printf's to the unixODBC code around where its calling SQLExecDirect or SQLExecute and show that its not returning SQL_SUCCESS (0). So basically you are trying to show that something doesn't happen.

v-chojas commented 2 months ago

You can also try to turn on the ODBC trace and see if it shows the driver returning an error.

lurcher commented 2 months ago

On 17/04/2024 16:14, v-chojas wrote:

You can also try to turn on the ODBC trace and see if it shows the driver returning an error.

Yes, I guess I had assumed that was already tried. But yes. That will show whats being returned from the call.