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 9051207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:51:09+00:00 2026-06-16T12:51:09+00:00

I launch a pl/sql script by a PHP application but I notice when there

  • 0

I launch a pl/sql script by a PHP application but I notice when there is either an insert, an update or a delete in the script, the script stops. While there is no problem if I use this script directly in sqldeveloper.

Is there something particular to do in order to use insert, delete, update ?
Thanks

 procedure update_nbr_execution
 (dem_id in number)
 IS
 BEGIN
UPDATE BCN_DEMANDE_EXTRACTION
    SET nombre_execution = nvl(nombre_execution,0) + 1
    WHERE id = dem_id;
 END;

In my php file :

            $query = "BEGIN 
                        ecrire_requete(:demande_id, :p_nom); 
                    END;";

            $stid = oci_parse($conn, $query);
            $tabvars = oci_new_collection($conn,'MYTABLETYPE');
            oci_bind_by_name($stid, ':p_nom', $tabvars, -1, SQLT_NTY);
            oci_bind_by_name($stid, ':demande_id', $_POST['demande_id']);
            oci_execute($stid, OCI_DEFAULT);

And update_nbr_execution is call by ecrire_requete.

There is a trigger involve in update_nbr_execution, a field date is automatically update with the fiel nbr_execution. May it come from the trigger ?

Edit : after isolating some part, I’m now getting this error : ORA-04088: error during execution of trigger. So it does come from the trigger which looks like this :

create or replace
TRIGGER BCN_FORMAT_NOM_FICHIER_BI
BEFORE INSERT OR UPDATE ON BCN_DEMANDE_EXTRACTION
REFERENCING NEW AS NEW
FOR EACH ROW

DECLARE
BEGIN
if inserting then
  :new.FORMAT_NOM_FICHIER_DONNEES:='bcn_<nom_lot>_<id demande>_<n° version>_<description>_<date>.dat';
  :new.FORMAT_NOM_FICHIER_CONTROLE:='bcn_<nom_lot>_<id demande>_<n° version>_<date>.ctr';
  :new.FORMAT_NOM_FICHIER_JETON:='bcn_<nom_lot>_<id demande>_<n° version>_<date>.jet';
  :new.FORMAT_NOM_FICHIER_ZIP:='bcn_<nom_lot>_<id demande>_<n° version>_<date>';
  :new.CREATED_AT:=TO_CHAR(SYSDATE,'DD/MM/YY');
  :new.UPDATED_AT:=TO_CHAR(SYSDATE,'DD/MM/YY');
else
   :new.UPDATED_AT:=TO_CHAR(SYSDATE,'DD/MM/YY');
end if;
END;
  • 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-16T12:51:10+00:00Added an answer on June 16, 2026 at 12:51 pm

    This is probably a date format issue.

    If CREATED_AT and UPDATED_AT are both dates, then = TO_CHAR(SYSDATE,'DD/MM/YY')
    will convert SYSDATE to a string, and then implicitly convert the string back to a date. The implicit date conversion
    depends on NLS_DATE_FORMAT, which is set by each client.

    You probably have SQL Developer set to use something like DD/MM/YY, but PHP is using something else. If you just
    want to remove the time from SYSDATE, you should use TRUNC(SYSDATE) instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the script from this answer https://stackoverflow.com/a/1681410/22 to insert a launch application
Application launch through Java web start(JWS) checks for update when we are launching it.
my website using php activerecord to handle the sql and there're three field inside
I want to launch psql.exe from an application. The user locates the script, so
I created and launch the SQLJ Java procedure (using SQL Developer). I have some
Please suppose that in SQL Server 2005, if you launch the following query: SELECT
Launch app from homescreen can't get remote push payload? But launch from Notification Center
In Microsoft SQL Server : I've added an insert trigger my table ACCOUNTS that
I'm having an divide by zero error when I launch this SQL query :
I heard of SQL Server CE but I wonder how do I apply it

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.