20230830 - 감사 Audit 컬럼

-- create tables

create table tbl_a (

    id                             number generated by default on null as identity 

                                   constraint tbl_a_id_pk primary key,

    col_a                          varchar2(4000 char),

    col_b                          varchar2(4000 char),

    created                        date not null,

    created_by                     varchar2(255 char) not null,

    updated                        date not null,

    updated_by                     varchar2(255 char) not null

)

;



-- triggers

create or replace trigger tbl_a_biu

    before insert or update 

    on tbl_a

    for each row

begin

    if inserting then

        :new.created := sysdate;

        :new.created_by := coalesce(sys_context('APEX$SESSION','APP_USER'),user);

    end if;

    :new.updated := sysdate;

    :new.updated_by := coalesce(sys_context('APEX$SESSION','APP_USER'),user);

end tbl_a_biu;

/


-- load data

 

-- Generated by Quick SQL Wednesday August 30, 2023  09:18:34

 

/*

tbl_a

  col_a

  col_b


# settings = { semantics: "CHAR", auditCols: true, language: "EN", APEX: true }

*/


20230830 - Local Timezone

select trunc(cast(from_tz(cast(SYSDATE as timestamp ), to_char(systimestamp, 'TZR')) at time zone 'Asia/Seoul' as date)) from dual


select trunc(cast(from_tz(cast(SYSDATE as timestamp ), to_char(systimestamp, 'TZR')) at time zone 'Asia/Kuala_Lumpur' as date)) from dual

20230830 - email 이메일 추출 REGEXP_SUBSTR(tags,'[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}')

 REGEXP_SUBSTR(tags,'[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}')

20250315 - 글로벌 변수 Global Variables

G_USER Specifies the currently logged in user. G_FLOW_ID Specifies the ID of the currently running application. G_FLOW_STEP_ID Specifi...