-- ====================================================================== -- SP 이름: 문자열 마스킹(F_MaskingText) -- ====================================================================== DROP FUNCTION IF EXISTS F_MaskingText(text, text, text, text) CASCADE; CREATE OR REPLACE FUNCTION F_MaskingText( i_pattern text , i_txt text , i_conv_txt text , i_option text ) RETURNS character varying AS $BODY$ DECL..
Back-End
t_table 에 있는 column 을 FUNCTION을 이용해서 선택하고 싶을 시 사용할 수 있는 EXECUTE format CREATE OR REPLACE FUNCTION FunctionName ( i_id character varying , i_row_seq integer , i_column character varying ) RETURNS refcursor AS $BODY$ DECLARE v_ref_cur_data refcursor := 'v_ref_cur_data'; v_id character varying := i_id; v_row_seq integer := i_row_seq; v_column character varying := i_column; BEGIN OPEN v_ref_cur_data..
확인 방법 $ which watch /usr/bin/watch 사용법 $ watch --help Usage: watch [options] command Options: -b --beep beep if command has a non-zero exit -c --color interpret ANSI color and style sequences -d --differences[=] highlight changes between updates -e --errexit exit if command has a non-zero exit -g --chgexit exit when output from command changes -n --interval seconds to wait between updates -p --p..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FtzDXS%2FbtqVIKUPGpu%2FtolfhR6hFgBw9yI64QqyFk%2Fimg.png)
컬럼들의 데이터를 합치는 방법 위와 같이 t_user_info 테이블에 phc란 아이디와 phc 5.0 이라는 이름이 있는데 아래의 두가지 방법으로 컬럼데이터를 합칠수 있습니다. || (버티컬바) 이용 select user_id || ' - ' || user_nm from t_user_info where user_id = 'phc' Concat select Concat(user_id, ' - ', user_nm) from t_user_info where user_id = 'phc'
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcmEjYE%2FbtqQu3FCe7m%2FDS5dTD5BynkXeISIEnx7TK%2Fimg.png)
만약 A,B,C,D 라는 데이터가 | 구분자로 다음과 같이 넣어져 있을때 분리 하는 방법은 regexp_split_to_table 를 사용하면 됍니다. 이거를 이용해서 쿼리에서 조건문을 걸수도 있습니다. SELECT 'A' IN (SELECT alpha FROM regexp_split_to_table('A|B|C|D', '\|') AS alpha) -- t SELECT 'E' IN (SELECT alpha FROM regexp_split_to_table('A|B|C|D', '\|') AS alpha) -- f'A|B|C|D' 데이터에 A가 존재하니 true 인 t가 출력이 되고, E는 존재하지 않으니 false 인 f가 출력이 됍니다. 위 쿼리를 이용해서 조건문을 걸어서 데이터를 변경 할 수도 있습니다...