Need to know how long takes the Select statement of the cursor?

Hi people
I want to know the duration of execution of the cursor in a stored procedure.

Piece of my code is provided below.

procedure Process_PCN_MAT_Custs)
p_PCN_OID in varchar2,
p_days_back number
) is
number of vcount;
v_newoid varchar2 (16);
date of pcn_create_date;
T_DATE: = to_char (sysdate, ' dd/mm/yyyy hh24:mi:ss');
cursor (SAP_Customers)
x_PCN_OID varchar2,
number of x_days_back
date of x_pcn_create_date
) is
Select
KUNNR,
Max (soldflag) soldflag,
Max (shipflag) shipflag,
Max (endflag) endflag,
Max (custName) custname
de)
Select / * + DRIVING_SITE (bims_pcn_shipments) * /.
KUNNR,
SoldFlag,
ShipFlag,
EndFlag,
custName
Of
bims_pcn_shipments_mview

where
material_number in (select sap_material_no from the 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
Of
bims_pcn_backlog_mview

where
material_number in (select sap_material_no from the pcn.material where pcn_oid = x_PCN_OID)
and bdr_date > (x_pcn_create_date - x_days_back)

)
Group
KUNNR;
dbms_output.put_line to_char (v_date);

Begin
Open SAP_CUSTOMERS
---
---
---
close SAP_CUSTOMERS
end

I get an error of compilation for this line [T_DATE: = to_char (sysdate, ' dd/mm/yyyy hh24:mi:ss');].
Saying "+ Error (95,12): PLS-00103: encountered the symbol"="when expected as follows: constant exception < an ID > < a double quote delimited identifier > table Fedya double Ref char time timestamp interval date binary character national nchar"< an ID >"symbol has been replaced for"="continue +.»

I would be grateful if someone can help me solve this weired compilation error.

Thank you
Vineet

Then you need to go to the function [DBMS_UTILITY. GET_TIME. http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14258/d_util.htm#sthref7809].

Something like that...

n := dbms_utility.get_time;

dbms_output.put_line( (dbms_utility.get_time-n)/100) || ' seconds....' );

Published by: Karthick_Arp on January 16, 2009 05:07

Tags: Database

Similar Questions

Maybe you are looking for