oracle存储过程编译错误请问是哪里错了
create or replace package mypackage as
type Leader_cursor is ref cursor;
end mypackage;
create or replace procedure Leader_proc_list(personId in Varchar2,p_cursor out mypackage.Leader_cursor) IS
HeadShipName VARCHAR2(40);
PostId VARCHAR2(40);
tabCstr VARCHAR(100);
tempcursor CURSOR;
chiledCursor CURSOR;
deptId VARCHAR2(40);
PId VARCHAR2(40);
parentDepId VARCHAR2(40);
tabData varchar2(500);
BEGIN
tabCstr:= 'create global temporary table BASEDB_USERS_TEMP_TB(
personid varchar2(40),
)ON COMMIT PRESERVE ROWS '; --ON COMMIT PRESERVE ROWS 会话级临时表 ,ON COMMIT delete ROWS 事务级临时表
execute immediate tabCstr;
OPEN tempcursor FOR SELECT Headship_Name,post_Id,dept_Id FROM v_com_person_dept_post WHERE person_id=personId;
LOOP
fetch tempcursor into HeadShipName,PostId,deptId;
exit when tempcursor%notfound;
IF HeadShipName='领导职务' THEN
SELECT Person_id,PARENT_ID into PId,parentDepId FROM V_COM_PERSON_DEPT WHERE Dept_id=dept_Id AND rownum =1 AND Headship_name='领导职务'
ORDER BY Sort_Number;
IF PId<>personId THEN --不是最小序号领导
tabData := 'insert into BASEDB_USERS_TEMP_TB(personid) values('+parentDepId+')';
execute immediate tabData using timePoint;