http://iotn.co.kr 연락처: gilho.kr@gmail.com [ The Japanese government should apologize to Japanese Military Sexual Slavery victim. / 日本政府は日本軍の性的奴隷?牲者に謝罪すべき. ]

사용자

ID:
PW:

INDEX
01.게시판
게시판 [69]
02.File Book
File 자료실 [95]
Site Link [18]
개인폴더 [194]
03.Field Book
Altibase [19]
Tibero [30]
MS-SQL [18]
MySQL [40]
DB2 [79]
ORACLE [2888]
PostgreSQL [103]
기타정보 [150]
운영체제 [577]
04.Q/A Book
Q/A [53]
05.방명록
방명록 [54]
레벨업 [37]
구인/구직 [2]

기념일
Search
LINK
+ 가족 Hompy
+ DNSEver
IOTN :: Field Book :: DB2

 회원가입

trigger test
최길호 [LIST]   2019-03-30 22:18:33, 조회 : 667

-- db2 9.7
create table trg_test ( id number,val number )
create table trg_log ( dt varchar2(10),dml varchar2(2),cnt number)

INSERT INTO TRG_LOG VALUES (TO_CHAR(SYSDATE,'YYYYMMDD'),'I',0)
INSERT INTO TRG_LOG VALUES (TO_CHAR(SYSDATE,'YYYYMMDD'),'D',0)
INSERT INTO TRG_LOG VALUES (TO_CHAR(SYSDATE,'YYYYMMDD'),'U',0)
INSERT INTO TRG_LOG VALUES (TO_CHAR(SYSDATE+1,'YYYYMMDD'),'I',0)
INSERT INTO TRG_LOG VALUES (TO_CHAR(SYSDATE+1,'YYYYMMDD'),'D',0)
INSERT INTO TRG_LOG VALUES (TO_CHAR(SYSDATE+1,'YYYYMMDD'),'U',0)
-- auto commit

CREATE OR REPLACE trigger trg_i
AFTER INSERT ON TRG_TEST FOR EACH ROW
UPDATE TRG_LOG SET CNT= CNT + 1 WHERE DT = TO_CHAR(SYSDATE,'YYYYMMDD') AND DML = 'I'

CREATE OR REPLACE trigger trg_u
AFTER UPDATE ON TRG_TEST FOR EACH ROW
UPDATE TRG_LOG SET CNT= CNT + 1 WHERE DT = TO_CHAR(SYSDATE,'YYYYMMDD') AND DML = 'U'

CREATE OR REPLACE trigger trg_d
AFTER DELETE ON TRG_TEST FOR EACH ROW
UPDATE TRG_LOG SET CNT= CNT + 1 WHERE DT = TO_CHAR(SYSDATE,'YYYYMMDD') AND DML = 'D'

insert into trg_test values ( 1,1001)
update trg_test set val = 1002
delete trg_test where id=1

select * from trg_test
select * from trg_log
update trg_log set cnt=0
3.238.125.76


  LIST

제목 작성자 작성일 조회
Install&Config  SQL30082N 이유 "42"("ROOT CAPABILITY REQUIRED")(으)로 인해 보안 처리에 실패했습니다.    최길호 2022/04/28 33
Troubleshoot  [jcc][t4][10205][11235][4.11.77] 널(NULL) password은(는) 지원되지 않습니다. ERRORCODE=-4461, SQLSTATE=42815    최길호 2020/10/24 496
Admin  DB2 상태 확인 status    최길호 2019/05/06 688
Admin  trigger test    최길호 2019/03/30 667
Admin  auto commit on/off    최길호 2019/03/30 931
Troubleshoot  DB21034E SQL0104N An unexpected token ";"/db2set DB2OPTIONS=-t/    최길호 2019/03/30 3743
Admin  dba_objects dba_tables    최길호 2019/03/26 685
Troubleshoot  sql trace / db2 login fail log    최길호 2019/03/22 845
Troubleshoot  SQL0332N Character conversion from the source code page "970" to the target code page "819" is not supported.    최길호 2019/02/22 825
Admin  db2 list application [ db2 session 정보 확인 ]    최길호 2019/02/09 691
Backup&Recovery  test    최길호 2019/02/05 1012
Troubleshoot  SQL6031N Error in the db2nodes.cfg file at line number "1". Reason code "10". [ hostname 변경 ]    최길호 2019/02/03 1193
Backup&Recovery  SQL1116N SQL2413N [ db2dart test /CHST /WHAT DBBP OFF ]    최길호 2014/04/22 4102
Troubleshoot  SQL0204N "DB2.TAB" is an undefined name. SQLSTATE=42704    최길호 2014/04/15 2908
Admin  db2 catalog tcpip node [ listener.ora, tnsnames.ora ]    최길호 2014/04/15 2078
Admin  test memo    최길호 2014/04/14 2374

    목록보기   다음페이지 1 [2][3][4]
       

Copyright 1999-2022 Zeroboard / skin by 최길호(gilho.kr@gmail.com)
최근 댓글
최근 게시물
06/29
[ORACLE]
DDE: Problem Key 'ORA 600 [133....
by 최길호
06/25
[ORACLE]
Replication may not be valid i....
by 최길호
06/22
[운영체제]
CentOS7 홈페이지 Migration 메모.
by 최길호