본문 바로가기
  • 노란색 세상은 어디에 있을까?
  • 봄이 오면 여기에 있겠지.
  • 잠시나마 유유자적 하겠네.
APEX-기본설정/공통버튼 설정

[ 저장-DML ] 버튼 추가 및 프로세스를 추가합니다.

by 태백성 2024. 4. 5.

DML 저장방식은 테이블 생성 / 트리거 생성 후 아래 작업을 진행합니다.

저장 버튼을 추가하며, 저장하기 위한 프로세스를 추가합니다.
● Identification
 - Button Name: Save
 - Label: 저장

● Appearance
 - Button Template: Text with Icon
 - Hot: Yes
 - Icon: fa-check-square-o

● Behavior
 - Action: Submit Page
● 저장시 테이블에 대한 키부분은 트리거를 사용하여 자동으로 저장합니다.
 - 테이블: bcom.com_user
 - 트리거: bcom.com_user_trg
create or replace trigger bcom.com_user_trg
    before insert or update on bcom.com_user
    for each row
begin
    if :new.user_id is null then
        :new.user_id := com_user_s.nextval;
    end if;

    if inserting then
        if :new.user_pwd is not null then
            :new.user_pwd := sys_crypto_api.encrypt_f(:new.user_pwd);
        end if;
    
        :new.create_date := systimestamp;
        :new.create_by   := nvl(wwv_flow.g_user, user);
    
    elsif updating then       
        if :new.user_pwd is not null and :new.user_pwd != :old.user_pwd then
            :new.user_pwd := sys_crypto_api.encrypt_f(:new.user_pwd);
        end if;           
    
    end if;

    :new.update_date := systimestamp;
    :new.update_by   := nvl(wwv_flow.g_user, user);
end;
● Process > Identification
 - Name: 사용자-저장
 - Type: Interactive Grid - Automatic Row Processing(DML)
 - Editable Region: 사용자-그리드

● Success Message
 - Success Message: 정상적으로 처리되었습니다.

● Error (시스템에서 발생하는 오류 메시지 메시지를 출력합니다.)
 - Error Message: #SQLERRM_TEXT#
 - Display Location: Inline in Notification

● Server-side Condition
 - When Button Pressed: Save
 - Execution Scope: For Created and Modified Rows

 

저장버튼 기능 테스트 결과입니다.