Creating oracle triggers from php... DOESN'T WORK!
Posted: Thu Oct 20, 2005 12:04 pm
Say I had enough of some problems with PHP and this is a top priority. Searched everywhere, seen this problem already posted and nobody got a single reply. Some posts were as old as 2001. Go figure 
Using php 5.0.2, but tested on 5.0.5 as well
Database: oracle 9i
Trying to create a trigger results in an invalid trigger being "created". Once that trigger is recompiled using an external tool, ther problem goes away. Say we have this trigger, a valid one that compiled just fine, no problem at all(except for php):
I tried all possibilities, w/out ;, w/out / etc.
The results are the same:
"Warning: ociexecute() [function.ociexecute]: OCIStmtExecute: OCI_SUCCESS_WITH_INFO: ORA-00000: normal, successful completion"
...and an invalid trigger in the database. Recompiled, it becomes 100% valid without adding/removing a single extra char. The ora user is the same in both cases.
This is what oracle has to say about the trigger php "creates":
So... I guess the time is right to come clean about it. Any chance it would work, what should be done if so?
If anybody from the zend engine/oci team here, do you plan to do anything about this?
PS: yes, I am mad... I mean, c'mon, since 2001?
EDIT: sorry, wrong forum. please move this topic to the database forum. thanks.
Using php 5.0.2, but tested on 5.0.5 as well
Database: oracle 9i
Trying to create a trigger results in an invalid trigger being "created". Once that trigger is recompiled using an external tool, ther problem goes away. Say we have this trigger, a valid one that compiled just fine, no problem at all(except for php):
Code: Select all
CREATE OR REPLACE TRIGGER trigger_name AFTER DELETE ON table1 REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW
BEGIN
IF((:OLD.col1 IS NOT NULL) AND (:OLD.col1 > 0)) THEN
UPDATE table2
SET col2 = col2 - 1
WHERE (id = :OLD.col1);
END IF;
END;The results are the same:
"Warning: ociexecute() [function.ociexecute]: OCIStmtExecute: OCI_SUCCESS_WITH_INFO: ORA-00000: normal, successful completion"
...and an invalid trigger in the database. Recompiled, it becomes 100% valid without adding/removing a single extra char. The ora user is the same in both cases.
This is what oracle has to say about the trigger php "creates":
Code: Select all
SQL> SHOW ERRORS TRIGGER intra_maila_afterd;
Errors for TRIGGER PHPCMS.INTRA_MAILA_AFTERD:
LINE/COL ERROR
1/6 PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge <a single-quoted SQL string> pipe <an alternatively-quoted SQL string> The symbol "" was ignored.
2/64 PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge <a single-quoted SQL string> pipe <an alternatively-quoted SQL string>If anybody from the zend engine/oci team here, do you plan to do anything about this?
PS: yes, I am mad... I mean, c'mon, since 2001?
EDIT: sorry, wrong forum. please move this topic to the database forum. thanks.