CASE EVENT_ID WHEN WF.STATUS_ID=0 THEN EVENT_ID=10003 WHEN WF.STATUS_ID=1 THEN EVENT_ID=10018 END AS EVENTID
Hai combinato due diverse sintassi di CASO dichiarazione.
1.simple_case_statement
CASE [ expression ]
WHEN condition_1 THEN result_1
WHEN condition_2 THEN result_2
...
WHEN condition_n THEN result_n
ELSE result
END
2.searched_case_statement
CASE
WHEN expression condition_1 THEN result_1
WHEN expression condition_2 THEN result_2
...
WHEN expression condition_n THEN result_n
ELSE result
END
Cambia la tua espressione in -
CASE
WHEN WF.STATUS_ID=0 THEN 10003
WHEN WF.STATUS_ID=1 THEN 10018
END AS EVENTID
Segui questo link per vedere la documentazione per entrambe le sintassi.
Aggiorna OP afferma di ricevere ancora l'errore di parola chiave mancante . Questo è un banco di prova per dimostrare che non è vero. La parola chiave mancante verrà corretta con l'istruzione CASE corretta.
SQL> CREATE OR REPLACE
2 PROCEDURE EXT_SELF_10003_SIGWF
3 AS
4 BEGIN
5 -- first empty TEMP_WF_WORKFLOW table
6 EXECUTE IMMEDIATE 'TRUNCATE TABLE TEMP_WF_WORKFLOW';
7 -- get WF_WORKFLOW table data
8 INSERT
9 INTO TEMP_WF_WORKFLOW
10 (
11 STATUS_ID,
12 EVENT_ID,
13 ORDER_NUMBER
14 )
15 SELECT WF.STATUS_ID,
16 CASE
17 WHEN WF.STATUS_ID=0
18 THEN 10003
19 WHEN WF.STATUS_ID=1
20 THEN 10018
21 END AS EVENTID,
22 TSM.ORDER_NUMBER
23 FROM [email protected]_RETAIL WF
24 JOIN TMP_SOAP_MONITORING_IDS TSM
25 ON TSM.SUBSCRIPTION_ID=WF.SUBSCRIPTION_ID
26 WHERE TSM.order_type ='SELF_REGISTRATION'
27 AND WF.NAME ='SIGNUP_MOBILE_PRE_PAID';
28 COMMIT;
29 END EXT_SELF_10003_SIGWF;
30 /
Warning: Procedure created with compilation errors.
SQL> sho err
Errors for PROCEDURE EXT_SELF_10003_SIGWF:
LINE/COL ERROR
-------- --------------------------------------------------
7/3 PL/SQL: SQL Statement ignored
23/8 PL/SQL: ORA-00942: table or view does not exist
SQL>