Need to know how much time the Select statement of the cursor is taking ?
Hi Folks
I want to know the execution time of the cursor in a Stored Procedure.
Piece of my code is furnished below.
procedure Process_PCN_MAT_Custs(
p_PCN_OID in varchar2,
p_days_back in number
) is
vcount number;
v_newoid varchar2(16);
pcn_create_date date;
v_date := to_char(sysdate,'dd/mm/yyyy hh24:mi:ss');
cursor SAP_Customers(
x_PCN_OID varchar2,
x_days_back number,
x_pcn_create_date date
) is
select
kunnr,
max(soldflag) soldflag,
max(shipflag) shipflag,
max(endflag) endflag,
max(custname) custname
from (
select /*+DRIVING_SITE(bims_pcn_shipments)*/
kunnr,
SoldFlag,
ShipFlag,
EndFlag,
custname
from
bims_pcn_shipments_mview
where
material_number in (select sap_material_no from pcn.material where pcn_oid = x_PCN_OID)
and bdr_date > (x_pcn_create_date - x_days_back)
UNION
select /*+DRIVING_SITE(bims_pcn_shipments)*/
kunnr,
SoldFlag,
ShipFlag,
EndFlag,
custname
from
bims_pcn_backlog_mview
where
material_number in (select sap_material_no from pcn.material where pcn_oid = x_PCN_OID)
and bdr_date > (x_pcn_create_date - x_days_back)
)
group by
kunnr;
dbms_output.put_line to_char(v_date);
Begin
Open SAP_CUSTOMERS
---
---
---
close SAP_CUSTOMERS
end
I am getting a compiliation error for this line [ v_date := to_char(sysdate,'dd/mm/yyyy hh24:mi:ss');].
Saying "+Error(95,12): PLS-00103: Encountered the symbol "=" when expecting one of the following: constant exception <an identifier> <a double-quoted delimited-identifier> table LONG_ double ref char time timestamp interval date binary national character nchar The symbol "<an identifier>" was substituted for "=" to continue+."
I would appreciate if anybody can help me to resolve this weired compilation error.
Thanks
Vineet