Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8941661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:21:24+00:00 2026-06-15T11:21:24+00:00

I am using PDO with the OCI driver. A particular INSERT query of mine

  • 0

I am using PDO with the OCI driver. A particular INSERT query of mine is causing a trigger error:

ERROR at line 1:
ORA-01403: no data found
ORA-06512: at "FOO.BAR", line 5
ORA-04088: error during execution of trigger 'FOO.BAR'

However, an exception is not being thrown when this happens. I am using ERRMODE_EXCEPTION, and exceptions are thrown fine for standard query syntax errors and such, but not for any error originating from a trigger.

The call to $st->execute() does not return FALSE in this case either. Also, $st->errorInfo() and $st->errorCode() are both unhelpful, as well:

array(3) {
  [0]=>
  string(5) "00000"
  [1]=>
  NULL
  [2]=>
  NULL
}
string(5) "00000"

How can I get PDO to throw an exception when a trigger error happens? Or, if that’s impossible, how can I programmatically detect when this happens by other means? The only way I even know that an error happened in the first place (aside from the database not being updated) is that $st->rowCount() is reporting 0. But this is not a unique or reliable way by itself of determining whether an error occurred…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:21:25+00:00Added an answer on June 15, 2026 at 11:21 am

    It’s impossible. Triggers (and events) are run on the DB based on DB actions and are not directly tied your query–at least as seen on the PHP side. Your PDO query is succeeding and that’s all your statement will ever know, the fact that a trigger was set up to do something based on the results of whatever your statement did to some table is irrelevant.

    The options you have are:

    1. write another query to confirm the success of whatever the trigger was supposed to do
    2. possibly wrap the initial query into a stored procedure that runs the query and verifys the success of the trigger action. Then call that stored proc instead of running the query directly.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using PDO to generate the following query: INSERT INTO MyTable (ID, Data) VALUES
I'm using PDO::query to run the following SQL statement: INSERT INTO pages (template_id,user_id,page_default,page_internal_title,page_menu_text,page_nav_link,globalcontent_id,page_parent_id,page_order,page_active,page_show_in_menu,page_hide,page_created,page_updated,page_deleted,page_type) values
I'm using PDO to insert a record (mysql and php) $stmt->bindParam(':field1', $field1, PDO::PARAM_STR); $stmt->bindParam(':field2',
I'm using PDO inside a database abstraction library function query that I've made. I'm
I have run into a problem using PDO because an error was not caught.
I am trying to retrieve the data from mysql database using PDO but I
I am trying to retrieve data from mysql database using PDO but DATABASE NOT
Hello i am using PDO 1st time and getting error ... dont no where
I am performing an sql query using PDO. In the resulting PDOStatement, there is
Using PDO to CRUD with SQLITE3. When I insert a string 'didn't', the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.