Symptom
- Declare a cursor in an Oracle package that executes a SELECT statement including the CASE statement.
- Reverse of the cursor is incomplete.
- The functions/procedures defined after the cursor have no definition reversed.
- It happens that the initialization part of the package body is empty, therefore, the keyword begin should not be present:
<<
Warning: Package Body created with compilation errors.
SQL> show error
Errors for PACKAGE BODY MLPKG01:
LINE/COL ERROR
-------- -----------------------------------------------------------------
17/1 PLS-00103: Encountered the symbol "END" when expecting one of the
following:
( begin case declare exit for goto if loop mod null pragma
raise return select update while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
continue close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge pipe purge
>>
This indicates that the “begin” statement should not be present (initialization part being empty).
If you change sample to
<<
/*==============================================================*/
create or replace package DBPKG1 is
procedure PROC1;
end DBPKG1;
/
create or replace package body DBPKG1 is
procedure PROC1 is
begin
PROC2;
insert into T1 (c1, c2)
select c1, c3 from T2
where c3='test';
PROC3;
end;
begin
-- Initialization
c3 := 3;
end DBPKG1;
/
/*==============================================================*/
>>
Then it will work.
Without initialization, remove the “begin” and it will work too.
"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."
Read more...
Environment
SAP PowerDesigner (PD)
Product
Keywords
Reverse, Engineer, cursor, oracle, select, case, not reversed , KBA , BC-SYB-PD , PowerDesigner , Bug Filed
About this page
This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).Search for additional results
Visit SAP Support Portal's SAP Notes and KBA Search.