Without TKPROF output it is difficult to pinpoint exact statement which is
causing all the problems. 

BUT wait .. you can optimize few things .... 

* You mention you are on 817, make use of BULK BINDING for handling all the
inserts, this will help speedup the process.

* If you create a Function based index for to_char(a.dtreadingtime, 'DY')
you can change the where clause to 
    "where to_char(a.dtreadingtime, 'DY')  NOT IN ('SAT','SUN')" all while
using the index. By using DAY, and by specifying 'SUNDAY  ' the compiler may
be doing more work

* Looks like tblcounter.id will be unique ... in which case make use of
intelligent keys for pl/sql table you are using. Instead of inserting rows
starting at location 1 onwards ... insert a row where the index value is
tbcounter.id. This way, you won't need the inline function GET_COL_NAME
because you can replace the function calls as 
"v_strrptcolname := tblcnt(cur_trans_rec.idcounter).strrptcolname;" there by
removing the in-line function and repeated scans on the pl/sql table.

* For all your insert statements use bulk binds ... thae means you save the
data to be inserted in pl/sql tables and then in one statement you insert
all rows.

HTH
Raj
______________________________________________________
Rajendra Jamadagni              MIS, ESPN Inc.
Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.

QOTD: Any clod can have facts, but having an opinion is an art !

*********************************************************************1

This e-mail message is confidential, intended only for the named recipient(s) above 
and may contain information that is privileged, attorney work product or exempt from 
disclosure under applicable law. If you have received this message in error, or are 
not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 
and delete this e-mail message from your computer, Thank you.

*********************************************************************1

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jamadagni, Rajendra
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to