Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need to know how much time the Select statement of the cursor is taking ?

Maestro_VineetJan 16 2009 — edited Jan 16 2009
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
This post has been answered by Karthick2003 on Jan 16 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 13 2009
Added on Jan 16 2009
15 comments
782 views