Home > database >  Operation is not successful, Oracle triggers execute statement alone run will be successful
Operation is not successful, Oracle triggers execute statement alone run will be successful

Time:09-22

This is my trigger: create or replace the trigger qingcerizhi after insert on table_qingce for each row
Declare
Sqlstr1 varchar2 (500);
The begin
Sqlstr1:='select execmd (' | |' localhost 'mysql - h - u ly - p159 mysql - execute=' | | '" insert into contactinfo (fid, telephone) values (' | | : new. The iscg | |', 123);" "' | | ') from dual ';
The execute immediate sqlstr1;
end;
Is to have data in table_qingce trigger when inserted, and then call execmd function performs CMD command to insert a mysql database data, such as I to insert data table_qingce (after 9, failure), can be found in the v $SQL select execmd (localhost 'mysql - h - u ly - p159 mysql - execute="insert into contactinfo (fid, telephone) values (9123);" ') from dual, but not the MySQL database and insert new data, make a copy of this statement out new open window to run SQL, MySQL database insert the new data, consult everybody a great god know what reason is this? Thank you very much ~ ~

CodePudding user response:

You haven't call the operating system command statements,

CodePudding user response:

reference 1st floor wmxcn2000 response:
you haven't call the operating system command statements,

Execmd is a custom function, custom function calls the Java source, find a tutorial on the Internet, a separate implementation can be successful

CodePudding user response:

Sqlstr1 statement, just a query operation, without executing your cmdexec,

CodePudding user response:

Well, vaguely remember oracle must commit to insert data, you didn't confirm the commit can add data to the database? I doubt that
  • Related