특정문자로 뒤에서부터 substring 하는 function
CREATE OR REPLACE FUNCTION LAST_FIELD (
V_FIELD IN VARCHAR2,
V_DELIMITER IN VARCHAR2
) RETURN VARCHAR2
IS
format_field VARCHAR2(100);
/******************************************************************************
NAME: LAST_FIELD
PURPOSE:REVISIONS:
Ver Date Author Description
--------- ---------- --------------- ------------------------------------
1.0 2008-09-09 1. Created this function.NOTES:
Automatically available Auto Replace Keywords:
Object Name: LAST_FIELD
Sysdate: 2008-09-09
Date and Time: 2008-09-09, 오전 10:16:36, and 2008-09-09 오전 10:16:36
Username: (set in TOAD Options, Procedure Editor)
Table Name: (set in the "New PL/SQL Object" dialog)******************************************************************************/
BEGIN
format_field := TRIM(SUBSTR(V_FIELD, INSTR(V_FIELD, V_DELIMITER, -1) +1));
RETURN format_field;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
RAISE;
END LAST_FIELD;
'DB' 카테고리의 다른 글
[QUERY] User 생성, 수정, 삭제 (0) | 2008.09.15 |
---|---|
[QUERY] Oracle User의 Object 조회 (0) | 2008.09.15 |
Toad 9.0 사용후기 공모당선작 (0) | 2008.08.12 |
ORA-03113: end-of-file on communication channel (0) | 2008.08.01 |
ORA-12154: TNS:could not resolve the connect identifier specified (0) | 2008.08.01 |