아래 쿼리를 실행하려고하면 다음 오류가 발생합니다.PLS-00103 : 다음 중 하나가 예상되면 "(") 기호가 나타납니다. <식별자><a doublequoted delimited-identifier> LONG_
ERROR at line 6:
ORA-06550 : 라인 6, 열 30 : PLS-00103 :가 발생했습니다 기호 "("다음 중 하나를 기대하는 경우 :
NCHAR LONG_ 더블 심판 문자 시간 소인 간격 날짜를 진 국가 문자를DECLARE
thisdb int;
maxDB int;
execStatement VARCHAR2 (120);
execStatement2 VARCHAR2 (120);
TYPE databaseIDs IS TABLE OF (EXECUTION_ID RAW (32));
BEGIN
INSERT INTO databaseIDs (EXECUTION_ID)
SELECT distinct jhist.EXECUTION_ID
FROM sysman.MGMT_JOB_HISTORY jhist, sysman.MGMT_JOB job
WHERE jhist.job_id=job.job_id and
job.job_owner='admin'
and jhist.step_status not in (1,5,17)
and start_time > (sysdate -1);
INSERT INTO databaseIDs (EXECUTION_ID)
SELECT distinct log_ID
FROM all_scheduler_job_log
WHERE owner = 'admin'
AND status <> 'SUCCEEDED'
AND log_date > (sysdate -1);
maxDB := select max(EXECUTION_ID) from databaseIDs;
thisdb := select min(EXECUTION_ID) from databaseIDs;
WHILE thisdb <= maxDB
LOOP
maxDB >= thisdb
END LOOP;
BEGIN
execStatement := (Select '
INSERT INTO TEST.JOB_FAILURES
SELECT distinct jhist.EXECUTION_ID,job_owner,job_name,
DECODE(step_status,
1, ''SCHEDULED'',
2, ''RUNNING'',
3, ''FAILED INIT'',
4, ''FAILED'',
5, ''SUCCEEDED'',
6, ''SUSPENDED'',
7, ''AGENT DOWN'',
8, ''STOPPED'',
9, ''SUSPENDED/LOCK'',
10, ''SUSPENDED/EVENT'',
11, ''SUSPENDED/BLACKOUT'',
12, ''STOP PENDING'',
13, ''SUSPEND PENDING'',
14, ''INACTIVE'',
15, ''QUEUED'',
16, ''FAILED/RETRIED'',
17, ''WAITING'',
18, ''SKIPPED'', step_status) AS STATUS,
cast(end_time AS timestamp) AS RUNDATE
FROM sysman.MGMT_JOB_HISTORY jhist, sysman.MGMT_JOB job
WHERE jhist.job_id=job.job_id and
job.job_owner='admin'
and jhist.step_status not in (1,5,17)
and start_time > (sysdate -1)
and jhist.EXECUTION_ID = '' + EXECUTION_ID + ''
WHERE NOT EXISTS ( SELECT distinct jhist.EXECUTION_ID
FROM sysman.MGMT_JOB_HISTORY jhist, sysman.MGMT_JOB job
WHERE jhist.job_id=job.job_id and
job.job_owner='DBadmin'
and jhist.step_status not in (1,5,17)
and start_time > (sysdate -1)
and jhist.EXECUTION_ID = '' + EXECUTION_ID + '';'from databaseIDs where EXECUTION_ID = thisdb);
--print execStatement
exec(execStatement)
execStatement2 := (Select '
INSERT INTO TEST.JOB_FAILURES
SELECT distinct owner,job_name,status, cast(log_date AS timestamp) as column1
FROM all_scheduler_job_log
WHERE
owner = 'admin' and
status <> 'SUCCEEDED'
and log_date > (sysdate -1)
and log_ID = '' + EXECUTION_ID + ''
WHERE NOT EXISTS ( SELECT distinct log_ID
FROM all_scheduler_job_log
WHERE
owner = 'admin' and
status <> 'SUCCEEDED'
and log_date > (sysdate -1)
and log_ID = '' + EXECUTION_ID + '';'from databaseIDs where EXECUTION_ID = thisdb);
--print execStatement
exec(execStatement2)
thisdb := (select min(EXECUTION_ID) from databaseIDs where EXECUTION_ID > thisdb)
END;
/
무엇이 누락 되었습니까?
[Oracle 매뉴얼] (http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/toc.htm)에서 구문을 찾았습니까? –
이것은 Oracle 구문과 같지 않음 – Aleksej
제목의 오류 메시지와 관련하여 [사용자 정의 식별자] (http://docs.oracle.com/database/121/LNPLS/fundamentals.htm#LNPLS002)는 a로 시작해야합니다. 편지가 아니라'@'. 'set' 명령도없고 다른 사람들이 언급 한 것처럼 명령문은 세미콜론으로 끝나야합니다. 나는 설명서를 한눈에 볼 필요가있을 것이라고 생각한다. –