sample below with comments in the place of the issue…
CREATE OR REPLACE PACKAGE BODY test123
AS
x varchar2(100) := ‘AR’;
PROCEDURE test11 (
p1 IN Number,
p2 IN NVARCHAR2,
p3 IN Number,
p4 OUT resultset,
p5 OUT resultset,
p6 OUT ResultSet
)
IS
v_pto date;
v_pc date;
v_plotid number(15);
begin
select o. – filter column does not work
max(o.OBJECT_NAME) t. – does not work because no comma after previous column and so all below will not work
into v_pto
from user_objects o
inner join user_tables t on t.TABLE_NAME = o.OBJECT_NAME
inner join user_tab_columns c on c.TABLE_NAME = t.TABLE_NAME
left join user_indexes i on i.TABLE_NAME = c.TABLE_NAME
where o.OBJECT_NAME = ‘’
group by o.OBJECT_TYPE;
if v_pc > v_pto then
select max(o.OBJECT_NAME)
into vv
from user_objects o
inner join user_tables t on t.TABLE_NAME = o.OBJECT_NAME
inner join user_tab_columns c on c.TABLE_NAME = t.TABLE_NAME and c.DATA_TYPE = ‘’
left join user_indexes i on i.TABLE_NAME = c.TABLE_NAME
where o.OBJECT_NAME = ‘’
order by o.OBJECT_TYPE;
end if;
Exception
when no_data_found then null;
end;
PROCEDURE test12 (
p1 IN Number,
p2 IN NVARCHAR2,
p3 IN Number,
p4 OUT resultset,
p5 OUT resultset,
p6 OUT ResultSet
)
IS
begin – try to fold here
begin
OPEN pownerdetailsdata FOR
select
Case When x = ‘EN’ Then
Case When o.OBJECT_NAME = 1 Then o.OBJECT_NAME Else Null End
Else
Case When o.OBJECT_NAME = 1 Then o.OBJECT_NAME Else Null End
End AS ss – nested case is the issue
from user_objects o
inner join user_tables t on t.TABLE_NAME = o.OBJECT_NAME
inner join user_tab_columns c on c.TABLE_NAME = t.TABLE_NAME
left join user_indexes i on i.TABLE_NAME = c.TABLE_NAME
where o.OBJECT_NAME = ‘’;
end;
begin
OPEN pownerdetailsdata FOR
select * from (
select o.OBJECT_NAME
from user_objects o
inner join user_tables t on t.TABLE_NAME = o.OBJECT_NAME
inner join user_tab_columns c on c.TABLE_NAME = t.TABLE_NAME and c.DATA_TYPE = ‘’
left join user_indexes i on i.TABLE_NAME = c.TABLE_NAME
where o.OBJECT_NAME = ‘’
group by o.OBJECT_NAME
ORDER BY sum (percentownership) over (partition by o.OwnerId, ownershipdeedacquisitiontype) desc
) b
where b.OBJECT_NAME = ‘’ ;
end;
end;
PROCEDURE test13 (
p1 IN Number,
p2 IN NVARCHAR2,
p3 IN Number,
p4 OUT resultset,
p5 OUT resultset,
p6 OUT ResultSet
)
IS
begin
begin
OPEN pownerdetailsdata FOR
select
distinct o.OBJECT_NAME
from user_objects o
inner join user_tables t on t.TABLE_NAME = o.OBJECT_NAME
inner join user_tab_columns c on c.TABLE_NAME = t.TABLE_NAME
left join user_indexes i on i.TABLE_NAME = c.TABLE_NAME
where o;
end;
begin
OPEN pownerdetailsdata FOR
select o.OBJECT_NAME
from user_objects o
inner join user_tables t on t.TABLE_NAME = o.OBJECT_NAME
inner join user_tab_columns c on c.TABLE_NAME = t.TABLE_NAME and c.DATA_TYPE = ‘’
left join user_indexes i on i.TABLE_NAME = c.TABLE_NAME
where o.OBJECT_NAME = ‘’
order by o.OBJECT_NAME;
end;
end;
end;
/