DECLARE c_ NUMBER; col_count_ NUMBER; v_sql VARCHAR2(100); col_name VARCHAR2(100); desc_tab_ DBMS_SQL.DESC_TAB; BEGIN v_sql := 'SELECT * FROM emp'; c_ := DBMS_SQL.OPEN_CURSOR; DBMS_SQL.PARSE(c_, v_sql, dbms_sql.v7); DBMS_SQL.DESCRIBE_COLUMNS(c_, col_count_, desc_tab_); FOR i_ IN 1..col_count_ LOOP col_name := desc_tab_(i_).col_name; DBMS_OUTPUT.PUT_LINE(col_name); END LOOP; DBMS_SQL.CLOSE_CURSOR(c_); END; /
오~ 감사합니다. ^^
이거 오라클 package procedure 가능하나요?
CREATE OR REPLACE package body USER_ERP.Share_Package as
procedure Sel_HR_Personnel
(
pEmployeeNameKor in HR_Personnel.EmployeeNameKor%type,
curData out cur_alm
)
Is
begin
Open curData for
Select
B.DepartText, A.EMPLOYEENO, A.EmployeeNameKor
From
HR_Personnel A, SET_DEPARTMENT B
where
A.Department = B.DepartCode and EmployeeNameKor Like pEmployeeNameKor;
end Sel_HR_Personnel;
End Share_Package;
결과 값이(컬럼정보만)
------------------------------
DepartText
EMPLOYEENO
EmployeeNameKor