Unable to create trigger in Oracle 11g via C++
Issue #8
resolved
Hi, i am not able to create trigger with bow code:
Connection_beginTransaction(con); Connection_execute(con,"create or replace TRIGGER CONTAQUE_SCHEDULER_TRIGGER BEFORE INSERT ON CONTAQUE_SCHEDULER REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT NG_scheduler_ID_SEQ.nextval INTO :NEW.ID FROM dual; END;"); Connection_commit(con);
Can you check and revert please what is wrong!! Note: same command works fine on sqlplus console.
Regards, Dhananjay
Comments (4)
-
-
repo owner - changed status to resolved
Fixes
#8Keep SQL terminator character ';'→ <<cset 1fbea480dcc0>>
-
repo owner Thanks guys
-
repo owner - removed version
Removing version: 3.0 (automated comment)
- Log in to comment
The problem is due to StringBuffer_trim being used in OracleCoonection_execute function of OracleConnection.c . So ideally this function should wither not be called or should only be called if the query does not contain END;
It is technically wrong to remove semicolon after END in trigger and this should be corrected in the source code .