MySQL Forums
Forum List  »  Quality Assurance

Use JDBC to query the trigger error
Posted by: jiacheng liang
Date: February 07, 2023 08:24PM

1. environment:
mysql5.7.39-log、JDBC8.0.28


2. steps
CREATE TABLE LSP.TEST_TRIGGLE_UPPER (
ID INT PRIMARY KEY AUTO_INCREMENT,
T_NOTE VARCHAR(30)
);

CREATE TABLE LSP.TEST_TRIGGLE_LOG (
ID INT PRIMARY KEY AUTO_INCREMENT,
T_LOG VARCHAR(30)
);
CREATE TRIGGER LSP.TRI_BEFORE_INSERT BEFORE INSERT ON LSP.TEST_TRIGGLE_UPPER
FOR EACH ROW
INSERT INTO TEST_TRIGGLE_LOG(T_LOG) VALUES('BEFORE insert.....');

SELECT TRIGGER_CATALOG,TRIGGER_SCHEMA,TRIGGER_NAME,EVENT_MANIPULATION,EVENT_OBJECT_CATALOG,EVENT_OBJECT_SCHEMA,EVENT_OBJECT_TABLE,ACTION_STATEMENT,ACTION_ORIENTATION,ACTION_TIMING FROM information_schema.triggers WHERE TRIGGER_SCHEMA = 'LSP' and TRIGGER_NAME = 'tri_before_insert';

3. actual results
def,LSP,TRI_BEFORE_INSERT,INSERT,def,LSP,TEST_TRIGGLE_UPPER,INSERT INTO TEST_TRIGGLE_LOG(T_LOG) VALUES('BEFORE insert.....'),ROW,BEFORE
def,LSP,tri_before_insert,INSERT,def,LSP,test_trigger,INSERT INTO test_trigger_log(t_log) VALUES('before insert.....'),ROW,BEFORE

4. expected outcome

def,LSP,tri_before_insert,INSERT,def,LSP,test_trigger,INSERT INTO test_trigger_log(t_log) VALUES('before insert.....'),ROW,BEFORE

Options: ReplyQuote


Subject
Views
Written By
Posted
Use JDBC to query the trigger error
334
February 07, 2023 08:24PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.