isNULL ( col_num , sql_data_type ) ;
|
if (!NEWROW.isNULL(1))
callStmt.setParam(1, (Integer) NEWROW.getValue(1, INTEGER)); if (!NEWROW.isNULL(2)) callStmt.setParam(2, (String) NEWROW.getValue(2, VARCHAR)); if (!NEWROW.isNULL(3)) callStmt.setParam(3, (java.math.BigDecimal) NEWROW.getValue(3, DECIMAL)) |
CREATE TRIGGER BUG_UPDATE_TRIGGER
AFTER UPDATE OF STATUS, PRIORITY ON BUG_INFO REFERENCING OLDROW, NEWROW FOR EACH ROW IMPORT import java.sql.* ; BEGIN try { // column number of STATUS is 10 String old_status, new_status; old_status = (String) OLDROW.getValue(10, CHAR); new_status = (String) NEWROW.getValue(10, CHAR); if ((old_status.CompareTo("OPEN") == 0) && (new_status.CompareTo("FIXED") == 0)) { // If STATUS has changed from OPEN to FIXED // increment the bugs_fixed_cnt by 1 in the // row corresponding to current month // and current year SQLIStatement update_stmt ( " update BUG_STATUS set bugs_fixed_cnt = bugs_fixed_cnt + 1 " " where month = ? and year = ?" ); . . . |