次のクエリを実行しようとすると、次のエラーが発生します。PLS-00103:以下のいずれかを予期しているときにシンボル「(」が検出されました:<識別子><doublequoted delimited-identifier> LONG_
ERROR at line 6:
ORA-06550:行6、列30: PLS-00103:記号が発生しました "(" 次のいずれかの期待:
NCHAR LONG_ ダブルREFチャータイムスタンプ間隔日付バイナリ国民 文字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'コマンドもなく、他の人も触れたように、ステートメントはセミコロンで終わらなければなりません。マニュアルの一見が必要かもしれないと思います。 –