What comands or different ways can I code this it's slow?

select claim_1.acct_nbr,
trim('LOC: '||nvl(osha.level_1,acct_level1.level_1)||' '||
          nvl(osha.level_2,acct_level2.level_2)||' '||
          nvl(osha.level_3,acct_level3.level_3)||' '||
          nvl(osha.level_4,acct_level4.level_4)||' '||
          nvl(osha.level_5,acct_level5.level_5))locations,
claim_1.clm_nbr case_nbr,
(nvl(osha.clmt_lst_name,claim_1.clmt_lst_name)) || ','|| (nvl(osha.clmt_first_name,claim_1.clmt_first_name)) name,
nvl(osha.occup,claim_1.occup)occup,
to_char(nvl(osha.dt_inj,claim_1.dt_inj),'mm/dd/yyyy')dt_inj,
nvl(osha.incident_location,incident.incident_location)incident_location,
nvl(osha.natr_of_inj,claim_1.natr_of_inj)natr_of_inj,
ijpb_desc.tbl_desc,
ijca_desc.tbl_desc,
to_char(claim_1.dt_death,'mm/dd/yyyy')dt_death,
decode(osha.injury_result_code,1,'X')death,
decode(osha.injury_result_code,2,'X')daysaway,
decode(osha.injury_result_code,3,'X')transfer,
decode(osha.injury_result_code,4,'X')other,
nvl(osha.actl_ldys_m1,absence.actl_ldys_m1)actl_ldys_m1,
osha.days_on_job_transfer,
decode(osha.injury_illness_code,1,'X')injury,
decode(osha.injury_illness_code,2,'X')skin,
decode(osha.injury_illness_code,3,'X')resp,
decode(osha.injury_illness_code,4,'X')pois,
decode(osha.injury_illness_code,5,'X')hearing,
decode(osha.injury_illness_code,6,'X')other
from group_security,acct_level1,acct_level2,acct_level3,acct_level4,acct_level5,
claim_1,absence,incident,osha_claim_user_log osha,ijpb_desc,ijca_desc
where
acct_level1.level1_seq_id(+) = claim_1.level1_seq_id_fk
and acct_level2.level2_seq_id(+) = claim_1.level2_seq_id_fk
and acct_level3.level3_seq_id(+) = claim_1.level3_seq_id_fk
and acct_level4.level4_seq_id(+) = claim_1.level4_seq_id_fk
and acct_level5.level5_seq_id(+) = claim_1.level5_seq_id_fk
and nvl(acct_level1.level_1,' ') =
decode(group_security.level1,null,nvl(acct_level1.level_1,' '),
nvl(group_security.level1,' '))
and nvl(acct_level2.level_2,' ') =
decode(group_security.level2,null,nvl(acct_level2.level_2,' '),
nvl(group_security.level2,' '))
and nvl(acct_level3.level_3,' ') =
decode(group_security.level3,null,nvl(acct_level3.level_3,' '),
nvl(group_security.level3,' '))
and nvl(acct_level4.level_4,' ') =
decode(group_security.level4,null,nvl(acct_level4.level_4,' '),
nvl(group_security.level4,' '))
and nvl(acct_level5.level_5,' ') =
decode(group_security.level5,null,nvl(acct_level5.level_5,' '),
nvl(group_security.level5,' '))
and group_security.acct_nbr = claim_1.acct_nbr
and claim_1.clm_seq_id = absence.clm_seq_id_fk(+)
and
(absence.dt_abs = ( select max(a.dt_abs)from absence a where a.clm_seq_id_fk = claim_1.clm_seq_id)
or
(not exists
(select * from absence a
where a.clm_seq_id_fk = claim_1.clm_seq_id)))
and claim_1.inc_seq_id_fk = incident.INC_SEQ_ID
and claim_1.clm_seq_id = osha.CLM_SEQ_ID(+)
and trim(ijpb_desc.tbl_cd) = trim(nvl(osha.part_of_body,claim_1.part_of_body))
and trim(ijca_desc.tbl_cd) = trim(nvl(osha.inj_cause,claim_1.inj_cause))
and claim_1.loi in ('SI','IN')
and nvl(osha.osha_recordable,'Y') = 'Y'
and group_security.group_id = 'DEMO'
and (claim_1.dt_inj between to_date('01/01/2003','MM/DD/YYYY') and to_date('12/31/2003','MM/DD/YYYY'))
this is very slow. The bottom claim_1.loi is where I think it is making it slow but there isn't away of not doing that.
Any idea's??

Justin what does the CBO and RBO stand for? What does it do?
Thanks for the help. We will have to see if we can get a plan together here. Do you feel I will have major problems with Discoverer running on Rule? I think I should be able to do it but it would be better if he changed to Cost.
I'm running into the DBA not wanting to give me tablespace for my materialized views so I have to fight for that. Then he wants to know what size they are going to be and I had so many issues running the estimate size I just didn't have rights. I now have the rights and the code comes back with bytes blank and num blank. I don't know where to go from here with the DBA. I have ran the code on several differnent tables and I get indentifet too long or I get the bytes with no byte count and the num with not number.
The DBA seems to never want to do anything for anyone. I have heard nothing but complaints.
here is what I did and I get nothing I have ran against may tables.. Any suggestions..
Thanks
variable num_rows number
variable num_bytes number
set autoprint on
set serveroutput on
BEGIN
dbms_olap.estimate_summary_size(stmt_id => '1',
select_clause =>
'select acct_nbr from csc.claim_1',
num_rows => :num_rows,
num_bytes => :num_bytes);
END;
PL/SQL procedure successfully completed.
NUM_BYTES
NUM_ROWS

Similar Messages

  • What are the different ways to upload file data to SAP? Please help

    Hi Experts,
       I have to transfer huge file data (few lakhs records) to SAP business transaction. What are the different ways to do the same? I have heard of BDC and LSMW. But are there any more options?
    Which option is best suited for huge file data?
    Is LSMW an old technology and SAP will not support it any more?
    Kindly answer my queries at the earliest.
    I will be greatful to you if you can help me.
    Thanks
    Gopal

    for uplodig data to non sap we have 2 methodes
    i) if u know bapi u will use lasm
    2) bdc
    but u mentioned so many records isthere
    best thing is u will uplode all record sto al11 using XI interface
    then u have to write bdc / lsmw  program
    beter to go for lsmw before that u will find bapi
    if u will unable to find bapi
    u have to create bapi and use it in lasmw
    ofter that u have schedule the lsmw program as a bockground
    then u have to create a job for it
    and release from sm 37
    then u have to moniter through bd87
    if u want to go through i will help u.
    if it is usefull to u pls give points
    Saimedha

  • What are the Different Ways of receiving Acknowlegements ?

    Hi Experts,
    Can you please let me know what are the Different Ways of receiving Acknowlegements from target system as a response to the Message sent from source system.
    As when we send Idoc to target system acknowledgement is sent through XI to Source system, what are the configuration steps required for it. Can we use Webservice or link which can be provided to target/customer system and acknowledgement is confirmed using this medium. Please suggest any possible option.
    Where I can find the related information or standard document about the same.
    Please guide.
    Regards,
    Nitin

    Hi ,
    Can you please let me know what are the Different Ways of receiving Acknowlegements from target system as a response to the Message sent from source system.
    System acknowledgments used by the runtime environment to confirm that an asynchronous message has reached the receiver.
    Application acknowledgments used to confirm that the asynchronous message has been successfully processed at the receiver
    These are of positive or Negative.
    As when we send Idoc to target system acknowledgement is sent through XI to Source system, what are the configuration steps required for it. Can we use Webservice or link which can be provided to target/customer system and acknowledgement is confirmed using this medium. Please suggest any possible option.
    This is based on your souce system to accept the ack, what is the protocol used to communicate with the source system.
    http://help.sap.com/saphelp_nw04/helpdata/EN/55/65c844539349e9b1450581ab44a5e6/frameset.htm
    Regards
    Harsha Paruchuri

  • What are the different ways to back up your photos from iphoto using a MacBook Pro which does not have a disk drive?

    What are the different ways to back up your photos from iphoto using a MacBook Pro which does not have a disk drive?

    Note - that no internet backup service has been proven to be safe and effective for backing up the iPhoto library - unless you personally have backup uyp an iPhoto library and restored it sucussfuly form one it should not be recommended - a large number of people have lost their photos trying it
    LN

  • What are the different ways of retrieving data from Oracle8i

    What are the different ways of retrieving data from Oracle8i
    into my HTML page ?
    Is it JDBC and ODBC ?
    Is there any other way ?
    null

    Methods I tried,
    Applet using SQLJ/JDBC with JDBC drivers thin or Oci8,
    Oracle Web Publishing Assistant,
    HTP/HTF PL/SQL packages (if you have OAS 4.0)
    Webserver Generator of Designer 2000 (if you have OAS 4.0)
    Arun (guest) wrote:
    : What are the different ways of retrieving data from Oracle8i
    : into my HTML page ?
    : Is it JDBC and ODBC ?
    : Is there any other way ?
    null

  • My Mac book air has been lost, how can i track? I have been already using Icloud id to track...but the system is still offline...what other ways can i track this?

    My Mac book air has been lost, how can i track? I have been already using Icloud id to track...but the system is still offline...what other ways can i track this?

    You cannot. Your best course of action is to immediately change all your internet passwords, notify the police and your insurance company. Send the remote wipe command to the MBA through iCloud.com and buy a new one from the insurance reimbursement.

  • We have always used one iTunes account and I want to crate a new account for my daughter.  What is the best way to go about this and will she need to download free apps again?

    We have always used one iTunes account and I want to crate a new account for my daughter.  What is the best way to go about this and will she need to download free apps again?

    Not going to happen the way you want it to.
    When you add a gift card balance to the Apple ID, it's available for the Apple ID.
    Probably best to create unique Apple ID's for each... this will also make things easier in the future as purchases are eternally tied to the Apple ID they were purchased with.

  • When connected to my computer, my iPhone is telling me I have books, but I have none on my phone. What is happening and how can I fix this?

    When I am connected to my computer to sync my iTunes and iPhone (4s) the 'log' in iTunes tells me I have three books installed on the device, but when I eject the phone, I have nothing installed.
    What is happening, and how can I stop this - it is starting to frustrate me.
    Thanks in advance.

    Put it into DFU mode - hold the sleep/wake button and home button until the screen goes black (ignoring the slide to turn off slider). When the screen goes black release the sleep/wake button but hold the home button. Continue holding the home button for 10 seconds, then release it. The screen should stay black. Plug it into iTunes and it should come up with this message "iTunes has detected an iPhone in recovery mode. It must be restored before use", that's when it is successfully in DFU mode. Now press the restore button in iTunes and it should run smoothly :)

  • A prompt that says "Could not use the clone stamp because the are to clone has not been defined (option-click to define a source point), appears EVERY time I try to use the clone stamp. What is wrong and how can I fix this

    A prompt that says "Could not use the clone stamp because the are to clone has not been defined (option-click to define a source point), appears EVERY time I try to use the clone stamp. What is wrong and how can I fix this?

    If a tool is acting up, one suggestion is to reset the tool.
    Ctrl-click on the clone tool icon in the Options bar and select Reset Tool.

  • How many different way can we call a BPEL process

    Hi Guys,
    How many ways can we call a BPEL process
    I know 3 ways
    1 ) Thru PLSQL 2) using Java API 3) From another BPEL Process.
    are there any other ways .... if so what are they ..... .
    Thanks
    Tom...

    Hi Tom,
    your normal BPEL process (a regular process you create with the "new BPEL process" wizard), can be configured in Oracle application server to be accessible
    - via SOAP over HTTP or
    - via JMS
    since it is has a WSDL based service interface.
    JDeveloper as well allows additionally more options for starting a BPEL process such as a file based interface, an e-mail as a starter etc.
    Still, I like to see the ESB as a virtualizer of the endpoint protocol, so I suggest you model the BPEL process regularly, exposing its functionality through WSDL and use ESB services that wrap your BPEL process to deal with the actual endpoints.
    Cheers,
    Hajo

  • What are the different ways to Export JTable to HTML file

    What would be best way of going about (well the easiest way) in exporting a jtable to html file, I can only think of one...
    Would it be to create file, then loop through Jtable and write data to the file using appriopiate tr, td tags..
    Are there any other methods which are better?

    Perhaps you could use XMLEncoder to write the JTable to an xml stream, and then use xslt to convert it into the html you want. Not sure if that is any easier.

  • What are the different ways in accessing the SQL server from NWDS ?

    Hi Experts,
    Can anyone suggest the different ways for accessing the SQL server from NWDS.I also want to know whether any tool is available for accessing SQL server from Webdynpro java application in Netweaver development studio.
    I am currently using JDBC driver for accessing the SQL server from Webdynpro java application in NWDS.
    Regards,
    Krishna Balaji T

    Note - that no internet backup service has been proven to be safe and effective for backing up the iPhoto library - unless you personally have backup uyp an iPhoto library and restored it sucussfuly form one it should not be recommended - a large number of people have lost their photos trying it
    LN

  • What are the different ways you guys add your favicon?

    I'm curious as to all the different ways people add their url favicon for their iWeb sites.
    What is the easiest way?

    Have a look here...
    http://iwebfaq.org/site/iWeb_Favicons.html

  • HT1750 What about TWO different numbers in MacOs (about this mac window) and on the bottom of the foot of the iMac ???

    What about TWO different serial numbers in macOs (about this mac window) and on the foot of the mac. This mac was not purchased as a refurbished nor has been sent for servicing on any time since purchasing...
    The one in MacOs is answering : "This is not a valid Apple Product serial number" when i try to check the iMac 1TB Seagate Hard Drive Replacement Program...

    You will need to check with Apple - might be a good idea to take it to a Genius Bar so they can see it for themselves (and the diagnosis is free).

  • What's the quickest way to slice up this image...

    I found this image and would like to slice it up into separate images. What's the quickest way to do this without having to manally select each one or manually draw slice lines?
    My idea was to get them all surrounded by a marquee or path, and then somehow export that marquee or path area into a file.
    The first part of creating the marquee and path was easy...
    I first surround the entire image with a black border so that it intersects the horizontal black divider lines
    I then used the magic want tool to select the black border which also selected the black divider lines
    I next inverted the selection... so now all the sections are selected perfectly
    Finally I right-clicked on the selection and picked "Make Work Path"
    But now how do I export all the work path sections into individual files?
    I would appreciate any help or advice... thanks.
    -Pete

    I was able to do it with a selection I saved named selection for a single frame. Then recording an action that I played moved the selection and played again repeated this till all frames were created. I then deleted the background layer aligned all layer to the top and created a frame animation.
    The script export layer to files will create files for each frame.

Maybe you are looking for

  • Getting pissed.  My jpeg is not showing up for me to post on Twitter or facebook or other programs!

    What the freak is going on?  Why am I having issues finding my jpeg to post on twitter, facebook or pull up into another program?  It only shows up in my photoshop program.  If the cloud service makes my jpegs only available for photoshop.  Then I wi

  • How best to set up multiple time capsules for multiple needs?

    There is so much good information on these discussions about using TCs for extenders or external drives - I am hoping to do both so will ask my own question here. BTW, this is my very first post so please be patient with me if I do not include someth

  • Using XSL-FO for Interactive Report PDF printout

    I am using XSL-FO, Apache FOP and use FO Designer to produce a PDF from SQL Based Report (not IR). This is working fine. How can use the same concept for Interactive Report. I can not see how to make IR to use XSL-FO and Apache FOP. It looks that IR

  • CS4 Bridge appears to have corrupted my IPhoto 09 library !

    I have MAC mini 10.6.8 Iphoto 09 and recently installed Adobe PS8 including CS4 bridge. I accessed teh briedge and browsed to my master IPhoto library. Now when I try and access the libraray through IPhoto I have at least the last year's photo missin

  • Help in Analytic functions

    I have a data in this format: ID 1 2 2 5 5 5 5I need to generate another column next to it in the below format: ID  Rnk 1    1 2    2 2    2 5    3 5    3 5    3 5    3Thank you Kumar