Number of times a Query is Run

Hi Experts,
I would like to find out:
1. what are the query names that are on my infocube(s) have been used most?
2. how many times each of these queires have run?
3. who are the users who ran these queries?
4. When was the last time each of these queries has run?
I am trying to looking up in RSDDSTAT, but i am not able to find "no. of times" each query has run

Here are the steps,
1.Goto ST03N
2.Select user mode as “Expert”
3.From Functions list (upper left pane) select “BW System Load” and under month selection, select your time duration
4.From the analysis view (down left pane) from the “Reporting” expand “Query Runtimes” and double click “BEx Queries”.
5.Output is shown in right pane.
6.Select aggregation level as query.
7.Double click on the query name
8.A window popup with every run of the query.
9.To find out, how many times it has run, click on “Display Graphics” button. It will show with no of runs as X-axis
OR
if you are working with BW 3.5 you can look in table RSDDSTAT in BI 7.0 it is RSDDSTAT_OLAP.
Make a selction on the infocube and the OLAP Statistic Object which is the query ID/tech name and execute. Then you should see how often the query was executed, by whom and which date/time.
Hope it helps..

Similar Messages

  • Adding a counter that keeps track of the total number of times a loop has run, even if LabVIEW has been restarted.

    Hi all,
    I am writing a VI for measuring data and inserting it into a database. The measurements are controlled by a loop that runs once every minute. I want to give each measurement a unique id number and store this too in the database.
    To do this, I want to add a counter to this loop so that I can count the number of times the loop has executed in total. This is, even if the VI, LabVIEW or even th PC is restarted, I want the counter to keep track of the number of executions. If say, the loope executes two times and then the VI is stopped and restarted, I want the following number on the counter to be three.
    Does anyone have an idea about how to do this? I am gratefule for any help!
    Clara
    Message Edited by Clara G on 05-11-2010 08:21 AM
    Solved!
    Go to Solution.

    Not allowed to give away code but I can describe one of my "Totalizers" used to keep track of how much stuff has passed through a fliter so we know when to change it.
    THe Total izer is implemented as an Action Engine.
    It has three actions (methods)
    1) Init - Opens an ini file and reads the last values read and cahces these in shift registers. It also inits a timer so we now how long since the last file I/O.
    2) Update - Uses the data passed by the caller to update the totals. It also checks how long since the last save and if more than one minute it writes to the ini file (forced write).
    3) Read - returns the totals for display and evealuating if a an alarm should be triggered to change the filter.
    Note:
    THe pre-LV 8.6 version of the ini file exposed methods to allow writing to the file. The new ini functions do not expose that functionality and require closing the file.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Query to show last time a query was run

    I am trying to write a query that will show me the last date/time a specific query was run. I have looked into v$sql and I can find the query, but from what I can tell it does not show the last time the query was executed.

    Hi,
    use v$sqlarea instead of v$sql and look at the column last_active_time. See also the documentation (docs.oracle.com/cd/E11882_01/server.112/e40402/title.htm) on the dynamic performance views in the database.
    You will get more answers, however, if you put your question to the forum Oracle Database > SQL and PL/SQL .
    Regards,
    Gudrun Pabst

  • BW Reporting - How to Count the number of times a query is executed

    Hi All,
    How do we get a report that enable us to get a count of number of times a report is executed? Example below:
    Info-provider         Report Name              Frequency
    PA_C01              Headcount                  24 times
    Any idea?
    Many thanks all.
    Mark Ng.

    Hi,
    1. Use Tcode = ST03N (Work Load Monitor)
    2. Choose Expert mode.
    3. Click on your system host name
    4. Click on Transaction Profile, then you can find out the all tasks.
    5. Select which ever you want to see details for queries.
    Regards,
    Srini Nookala

  • How can I run a counter by number of times the script is run

    So I've created a script for disabling exchange mailboxes and moving them to a disabled OU in AD.  I currently have this set to run once a week via scheduled tasks but instead would like to kick it up to nightly and improve on the logging.
    Right now, the only items I record are the name of the person and the OU they were originally in.  I'd also like to include the groups they were a member of.  I could easily enough include all the groups they were a member of in the email but here
    is the twist.
    Since we are going to a nightly run of this script, we would want to keep at least a weeks worth of logs in a text file as a just in case.  After a week, the log would be cleared.  I know that would be a counter but I can't even wrap my mind around
    how that would work.  Is it even possible?
    #Finds all users who have the AD attributes
    # wWWHomePage = Updated_by_GroupID
    # msExchHideFromAddressLists = True
    # msExchHomeServerName not empty
    # emailaddress contains @MyDomain.com
    # useraccountcontrol = 514 (disabled)
    Import-Module ActiveDirectory
    add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010
    #Declare Variables
    $users = $null
    $ADgroups = $null
    $username = $null
    $user = $null
    $LogFile = "C:\Scripts\TerminateUsersLogFile.txt"
    $LogFile2 = "C:\Scripts\UserNamesMovedtoDisabledOU.txt"
    $EmailLogTo = "[email protected]"
    #Generates log file
    Start-Transcript -path $LogFile
    #Performs search for all users in AD filtering only AD user with wWWWHomePage = Updated_by_GroupID, msExchHideFromAddressLists = True, msExchHomeServerName not empty and emailaddress contains @MyDomain.com
    $users = Get-ADUser -properties name, emailaddress -Filter {(HomePage -eq "Updated_by_GroupID") -and (msExchHideFromAddressLists -eq $true) -and (emailaddress -like "*@MyDomain.com") -and (msExchHomeServerName -ne "$null") -and (useraccountcontrol -eq "514")}
    $users.name -Replace '^cn=([^,]+).+$','$1'
    #loops through all users
    foreach ($user in $users){
    $user.name -Replace '^cn=([^,]+).+$','$1'
    #Copies the current OU into the Notes field in the AD User Object.
    $newvar = ($user).distinguishedname
    set-aduser $user -replace @{info="$newvar"}
    # Removes user from all AD groups except Domain Users.
    $ADgroups = Get-ADPrincipalGroupMembership -Identity $user | where {$_.Name -ne "Domain Users"}
    Remove-ADPrincipalGroupMembership -Identity "$($user)" -MemberOf $ADgroups -Confirm:$false
    #Disables their Exchange Mailbox.
    Disable-Mailbox -Identity $user.EmailAddress -Confirm:$False
    #Moves their AD user object to disabled OU.
    Move-ADObject -Identity "$($user.DistinguishedName)" -TargetPath "Disabled Users OU" -Confirm:$false
    Write-Output $user.name >> C:\Scripts\UserNamesMovedtoDisabledOU.txt
    Stop-Transcript
    # Email the log file
    $emailFrom = "[email protected]"
    $emailTo = $EmailLogTo
    $subject = "Terminated Users Cleaned in AD"
    $content = Get-Content $LogFile2 | ForEach-Object {$_.Split("`r`n")}
    $body = [string]::Join("`r`n",$content)
    $smtpServer = "SMTP.MyDomain.com"
    $smtp = new-object Net.Mail.SmtpClient($smtpServer)
    $smtp.Send($emailFrom, $emailTo, $subject, $body)
    clear-content C:\Scripts\UserNamesMovedtoDisabledOU.txt

    I apologize for the long delay in replying.  I thank everyone for their help but I'm still running into issues with the script.  Below is the script as it is right now.  I'm having issues with logging as the groups the associate is a member
    of are not logging correctly.
    #Finds all users who have the AD attributes
    # wWWHomePage = Updated_by_GroupID
    # msExchHideFromAddressLists = True
    # msExchHomeServerName not empty
    # emailaddress contains @MyDomain.com
    # useraccountcontrol = 514 (disabled)
    Import-Module ActiveDirectory
    add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010
    #Declare Variables
    $users = $null
    $ADgroups = $null
    $username = $null
    $user = $null
    $LogFile = "C:\Scripts\CleanUpTermedUsers\TerminateUsersLogFile.log"
    $LogFile2 = "C:\Scripts\CleanUpTermedUsers\UserNamesMovedtoDisabledOU.txt"
    $EmailLogTo = "[email protected]"
    #Generates log file
    Start-Transcript -path $LogFile
    #Performs search for all users in AD filtering only AD user with wWWWHomePage = Updated_by_GroupID, msExchHideFromAddressLists = True, msExchHomeServerName not empty and emailaddress contains @mydomain.com
    $users = Get-ADUser -properties name, emailaddress -Filter {(HomePage -eq "Updated_by_GroupID") -and (msExchHideFromAddressLists -eq $true) -and (emailaddress -like "*@mydomain.com") -and (msExchHomeServerName -ne "$null") -and (useraccountcontrol -eq "514")}
    $users.name -Replace '^cn=([^,]+).+$','$1'
    #loops through all users
    foreach ($user in $users){
    $user.name -Replace '^cn=([^,]+).+$','$1'
    #Copies the current OU into the Notes field in the AD User Object.
    $UserOU = ($user).distinguishedname
    set-aduser $user -replace @{info="$UserOU"}
    # Removes user from all AD groups except Domain Users.
    $ADgroups = Get-ADPrincipalGroupMembership -Identity $user | where {$_.Name -ne "Domain Users"}
    Write-Output $user.name >> C:\Scripts\CleanUpTermedUsers\UserNamesMovedtoDisabledOU.txt
    write-output $ADgroups.name >> C:\Scripts\CleanUpTermedUsers\UserNamesMovedtoDisabledOU.txt
    echo $ADgroups.name
    Remove-ADPrincipalGroupMembership -Identity "$($user)" -MemberOf $ADgroups -Confirm:$false
    #Disables their Exchange Mailbox.
    Disable-Mailbox -Identity $user.EmailAddress -Confirm:$False
    #Moves their AD user object to disabled OU.
    Move-ADObject -Identity "$($user.DistinguishedName)" -TargetPath "Disabled OU" -Confirm:$false
    Stop-Transcript
    # Email the log file
    $emailFrom = "[email protected]"
    $emailTo = $EmailLogTo
    $subject = "Terminated Users Cleaned in AD"
    $content = Get-Content $LogFile2 | ForEach-Object {$_.Split("`r`n")}
    $body = [string]::Join("`r`n",$content)
    $smtpServer = "smtp.mydomain.com"
    $smtp = new-object Net.Mail.SmtpClient($smtpServer)
    $smtp.Send($emailFrom, $emailTo, $subject, $body)
    Get-ChildItem -Path C:\Scripts\CleanUpTermedUsers\* -Include *.log | where-object { $_.LastWriteTime -lt $((Get-date).Adddays(-7))} | clear-content C:\Scripts\CleanUpTermedUsers\TerminateUsersLogFile.log
    Clear-Content c:\Scripts\CleanUpTermedUsers\UserNamesMovedtoDisabledOU.txt

  • Query is running from a long time

    it just keeps running for a long time without returning any results.
    I am pasting here the execution plan for this query,please let me know which part could tune ,
    | Id  | Operation                                  | Name                     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                           |                          |    27 |  9720 |   182K  (1)| 00:42:31 |
    |   1 |  SORT GROUP BY                             |                          |    27 |  9720 |   182K  (1)| 00:42:31 |
    |   2 |   VIEW                                     |                          |    27 |  9720 |   182K  (1)| 00:42:31 |
    |   3 |    HASH GROUP BY                           |                          |    27 | 14283 |   182K  (1)| 00:42:31 |
    |*  4 |     HASH JOIN                              |                          |    27 | 14283 |   182K  (1)| 00:42:31 |
    |*  5 |      HASH JOIN                             |                          |    26 |  9568 |   166K  (1)| 00:38:56 |
    |   6 |       NESTED LOOPS                         |                          |    26 |  9048 |   160K  (1)| 00:37:29 |
    |   7 |        NESTED LOOPS                        |                          |    25 |  7950 |   160K  (1)| 00:37:28 |
    |*  8 |         HASH JOIN                          |                          |    25 |  7800 |   160K  (1)| 00:37:28 |
    |*  9 |          HASH JOIN                         |                          |    25 |  7050 |   134K  (1)| 00:31:18 |
    |* 10 |           HASH JOIN                        |                          |    25 |  6600 |   107K  (1)| 00:25:08 |
    |* 11 |            TABLE ACCESS FULL               | WC_WRK_SPEC_F            |  2288 | 84656 |  4405   (2)| 00:01:02 |
    |  12 |            NESTED LOOPS                    |                          | 16275 |  3607K|   103K  (1)| 00:24:06 |
    |  13 |             NESTED LOOPS                   |                          |   592 |   121K|   102K  (1)| 00:23:49 |
    |* 14 |              HASH JOIN                     |                          |   592 | 47952 | 99684   (1)| 00:23:16 |
    |* 15 |               TABLE ACCESS BY INDEX ROWID  | W_PERSON_D               | 14057 |   700K| 90700   (1)| 00:21:10 |
    |  16 |                BITMAP CONVERSION TO ROWIDS |                          |       |       |            |          |
    |  17 |                 BITMAP AND                 |                          |       |       |            |          |
    |  18 |                  BITMAP OR                 |                          |       |       |            |          |
    |* 19 |                   BITMAP INDEX SINGLE VALUE| IXDIM_W_PERSON_D_F27     |       |       |            |          |
    |* 20 |                   BITMAP INDEX SINGLE VALUE| IXDIM_W_PERSON_D_F27     |       |       |            |          |
    |* 21 |                   BITMAP INDEX SINGLE VALUE| IXDIM_W_PERSON_D_F27     |       |       |            |          |
    |* 22 |                   BITMAP INDEX SINGLE VALUE| IXDIM_W_PERSON_D_F27     |       |       |            |          |
    |* 23 |                   BITMAP INDEX SINGLE VALUE| IXDIM_W_PERSON_D_F27     |       |       |            |          |
    |* 24 |                  BITMAP INDEX SINGLE VALUE | W_PERSON_D_M14           |       |       |            |          |
    |  25 |               NESTED LOOPS                 |                          | 62915 |  1843K|  8983   (1)| 00:02:06 |
    |* 26 |                TABLE ACCESS FULL           | WC_WRK_SPEC_F            |  2288 | 57200 |  4405   (2)| 00:01:02 |
    |  27 |                BITMAP CONVERSION TO ROWIDS |                          |    27 |   135 |  8983   (1)| 00:02:06 |
    |* 28 |                 BITMAP INDEX SINGLE VALUE  | W_PER_RANK_F_F7          |       |       |            |          |
    |* 29 |              TABLE ACCESS BY INDEX ROWID   | W_PERSON_D               |     1 |   129 |     4   (0)| 00:00:01 |
    |* 30 |               INDEX RANGE SCAN             | W_PERSON_D_U1            |     1 |       |     2   (0)| 00:00:01 |
    |  31 |             BITMAP CONVERSION TO ROWIDS    |                          |    27 |   459 |   103K  (1)| 00:24:06 |
    |* 32 |              BITMAP INDEX SINGLE VALUE     | W_PER_RANK_F_F7          |       |       |            |          |
    |* 33 |           TABLE ACCESS FULL                | WC_CUST_INST_F           | 33386 |   586K| 26431   (2)| 00:06:11 |
    |* 34 |          TABLE ACCESS FULL                 | WC_CUST_INST_F           | 33386 |   978K| 26431   (2)| 00:06:11 |
    |* 35 |         INDEX UNIQUE SCAN                  | W_PERSON_D_P1            |     1 |     6 |     1   (0)| 00:00:01 |
    |  36 |        TABLE ACCESS BY INDEX ROWID         | W_PERSON_D               |     1 |    30 |     2   (0)| 00:00:01 |
    |* 37 |         INDEX UNIQUE SCAN                  | W_PERSON_D_P1            |     1 |       |     1   (0)| 00:00:01 |
    |* 38 |       VIEW                                 | index$_join$_003         |   287K|  5616K|  6215   (3)| 00:01:28 |
    |* 39 |        HASH JOIN                           |                          |       |       |            |          |
    |* 40 |         HASH JOIN                          |                          |       |       |            |          |
    |  41 |          BITMAP CONVERSION TO ROWIDS       |                          |   287K|  5616K|    47   (0)| 00:00:01 |
    |* 42 |           BITMAP INDEX SINGLE VALUE        | IXDIM_WC_CUST_ADDR_D_F07 |       |       |            |          |
    |  43 |          BITMAP CONVERSION TO ROWIDS       |                          |   287K|  5616K|    85   (0)| 00:00:02 |
    |* 44 |           BITMAP INDEX SINGLE VALUE        | IXDIM_WC_CUST_ADDR_D_F04 |       |       |            |          |
    |  45 |         BITMAP CONVERSION TO ROWIDS        |                          |   287K|  5616K|  5895   (1)| 00:01:23 |
    |  46 |          BITMAP INDEX FULL SCAN            | IXDIM_WC_CUST_ADDR_D_F02 |       |       |            |          |
    |  47 |      TABLE ACCESS BY INDEX ROWID           | WC_CUST_ADDR_D           |   152K|    23M| 15400   (1)| 00:03:36 |
    |  48 |       BITMAP CONVERSION TO ROWIDS          |                          |       |       |            |          |
    |  49 |        BITMAP AND                          |                          |       |       |            |          |
    |* 50 |         BITMAP INDEX SINGLE VALUE          | IXDIM_WC_CUST_ADDR_D_F07 |       |       |            |          |
    |* 51 |         BITMAP INDEX SINGLE VALUE          | IXDIM_WC_CUST_ADDR_D_F06 |       |       |            |          |
    |* 52 |         BITMAP INDEX SINGLE VALUE          | IXDIM_WC_CUST_ADDR_D_F05 |       |       |            |          |
    Predicate Information (identified by operation id):
       4 - access("T489839"."ROW_WID"="T555160"."CONTACT_WID")
       5 - access("T489839"."ROW_WID"="T555160"."CONTACT_WID")
       8 - access("T489839"."ROW_WID"="T565669"."CONTACT_WID")
       9 - access("T489839"."ROW_WID"="T565669"."CONTACT_WID")
      10 - access("T445248"."CONTACT_WID"="T565813"."CONTACT_WID")
      11 - filter("T565813"."WRK_SPECIALITY"='01 Allm??Allm??edicin')
      14 - access("T445248"."CONTACT_WID"="T489839"."ROW_WID")
      15 - filter("T489839"."X_BU_NAME"='NNEU Sweden' AND ("T489839"."VIS_PR_BU_ID"='1-A30BR' OR
                  "T489839"."VIS_PR_BU_ID"='1-A37AL' OR "T489839"."VIS_PR_BU_ID"='1-B67SM' OR "T489839"."VIS_PR_BU_ID"='1-DEN82'
                  OR "T489839"."VIS_PR_BU_ID"='Unspecified') AND ("T489839"."X_CUST_STAT_CD"='Active' OR
                  "T489839"."X_CUST_STAT_CD"='New' OR "T489839"."X_CUST_STAT_CD"='Pending Validation' OR
                  "T489839"."X_CUST_STAT_CD"='Unspecified'))
      19 - access("T489839"."VIS_PR_BU_ID"='1-A30BR')
      20 - access("T489839"."VIS_PR_BU_ID"='1-A37AL')
      21 - access("T489839"."VIS_PR_BU_ID"='1-B67SM')
      22 - access("T489839"."VIS_PR_BU_ID"='1-DEN82')
      23 - access("T489839"."VIS_PR_BU_ID"='Unspecified')
      24 - access("T489839"."EMP_FLG"='N')
      26 - filter("T565813"."WRK_SPECIALITY"='01 Allm??Allm??edicin')
      28 - access("T445248"."CONTACT_WID"="T565813"."CONTACT_WID")
      29 - filter("T489839"."X_BU_NAME"='NNEU Sweden' AND ("T489839"."VIS_PR_BU_ID"='1-A30BR' OR
                  "T489839"."VIS_PR_BU_ID"='1-A37AL' OR "T489839"."VIS_PR_BU_ID"='1-B67SM' OR "T489839"."VIS_PR_BU_ID"='1-DEN82'
                  OR "T489839"."VIS_PR_BU_ID"='Unspecified') AND "T489839"."EMP_FLG"='N')
      30 - access("T489839"."INTEGRATION_ID"="T489839"."INTEGRATION_ID")
      32 - access("T445248"."CONTACT_WID"="T489839"."ROW_WID")
      33 - filter("T565669"."X_REL_TYPE_CD"='Ass Spe' OR "T565669"."X_REL_TYPE_CD"='AssDist Health C' OR
                  "T565669"."X_REL_TYPE_CD"='Dis Health C Ctr' OR "T565669"."X_REL_TYPE_CD"='DisHealth C Ctr' OR
                  "T565669"."X_REL_TYPE_CD"='DistHealth C' OR "T565669"."X_REL_TYPE_CD"='Distr Healt Ch' OR
                  "T565669"."X_REL_TYPE_CD"='District Health' OR "T565669"."X_REL_TYPE_CD"='Graduate physician' OR
                  "T565669"."X_REL_TYPE_CD"='Home Health Care Physician' OR "T565669"."X_REL_TYPE_CD"='Spe RecSenior' OR
                  "T565669"."X_REL_TYPE_CD"='SpeRecSen' OR "T565669"."X_REL_TYPE_CD"='SpeRecSpec' OR
                  "T565669"."X_REL_TYPE_CD"='SpeRecep')
      34 - filter("T565669"."X_REL_TYPE_CD"='Ass Spe' OR "T565669"."X_REL_TYPE_CD"='AssDist Health C' OR
                  "T565669"."X_REL_TYPE_CD"='Dis Health C Ctr' OR "T565669"."X_REL_TYPE_CD"='DisHealth C Ctr' OR
                  "T565669"."X_REL_TYPE_CD"='DistHealth C' OR "T565669"."X_REL_TYPE_CD"='Distr Healt Ch' OR
                  "T565669"."X_REL_TYPE_CD"='District Health' OR "T565669"."X_REL_TYPE_CD"='Graduate physician' OR
                  "T565669"."X_REL_TYPE_CD"='Home Health Care Physician' OR "T565669"."X_REL_TYPE_CD"='Spe RecSenior' OR
                  "T565669"."X_REL_TYPE_CD"='SpeRecSen' OR "T565669"."X_REL_TYPE_CD"='SpeRecSpec' OR
                  "T565669"."X_REL_TYPE_CD"='SpeRecep')
      35 - access("T36044"."ROW_WID"="T445248"."CONTACT_WID")
      37 - access("T36044"."ROW_WID"="T445248"."CONTACT_WID")
      38 - filter("T555160"."COUNTRY"='Sweden' AND "T555160"."NN_PRIMARY"='Y')
      39 - access(ROWID=ROWID)
      40 - access(ROWID=ROWID)
      42 - access("T555160"."COUNTRY"='Sweden')
      44 - access("T555160"."NN_PRIMARY"='Y')
      50 - access("T555160"."COUNTRY"='Sweden')
      51 - access("T555160"."MAIN_ADDR_FLG"='Y')
      52 - access("T555160"."ACTIVE_FLG"='Y')

    Here I am pasting the tkprof's output:
    tkprof p002_ora_32614_MY_TEST_SESSION02.trc abc.txt sys=no sort=prsela exeela fchela
    Please suggest:
    TKPROF: Release 10.2.0.5.0 - Production on Wed Sep 28 14:21:48 2011
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Trace file: p002_ora_32614_MY_TEST_SESSION02.trc
    Sort options: prsela  exeela  fchela 
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    WITH SASUBWITH0 AS
      (SELECT D1.c1 AS c1
       FROM
         (SELECT T489839.INTEGRATION_ID AS c1,
                         count(DISTINCT T36044.INTEGRATION_ID) AS c2
          FROM WC_WRK_SPEC_F T565813,
                             WC_CUST_ADDR_D T555160,
                                            W_PERSON_D T489839 /* Custom Contact Dim_W_PERSON_D_Contact */, WC_CUST_INST_F T565669,
                                                                                                                           W_PERSON_D T36044,
                                                                                                                                      W_PER_RANK_F T445248 /* Fact_W_PER_RANK_F */
          WHERE (T445248.CONTACT_WID = T565813.CONTACT_WID
                 AND T36044.ROW_WID = T445248.CONTACT_WID
                 AND T445248.CONTACT_WID = T489839.ROW_WID
                 AND T489839.ROW_WID = T555160.CONTACT_WID
                 AND T489839.ROW_WID = T565669.CONTACT_WID
                 AND T489839.EMP_FLG = 'N'
                 AND T489839.X_BU_NAME = 'NNEU Sweden'
                 AND T555160.NN_PRIMARY = 'Y'
                 AND T555160.COUNTRY = 'Sweden'
                 AND T565813.WRK_SPECIALITY = '01 Allm��Allm��edicin'
                 AND (T489839.VIS_PR_BU_ID IN ('1-A30BR',
                                               '1-A37AL',
                                               '1-B67SM',
                                               '1-DEN82',
                                               'Unspecified'))
                 AND (T489839.X_CUST_STAT_CD IN ('Active',
                                                 'New',
                                                 'Pending Validation',
                                                 'Unspecified'))
                 AND (T565669.X_REL_TYPE_CD IN ('Ass Spe',
                                                'AssDist Health C',
                                                'Dis Health C Ctr',
                                                'DisHealth C Ctr',
                                                'DistHealth C',
                                                'Distr Healt Ch',
                                                'District Health',
                                                'Graduate physician',
                                                'Home Health Care Physician',
                                                'Spe RecSenior',
                                                'SpeRecep',
                                                'SpeRecSen',
                                                'SpeRecSpec')))
          GROUP BY T489839.INTEGRATION_ID ) D1)
    SELECT T489839.SUPPRESS_MAIL_FLG AS c1,
                   CASE
                       WHEN T489839.JOB_TITLE = 'Unspecified' THEN ''
                       ELSE T489839.JOB_TITLE
                   END AS c2,
                   CASE
                       WHEN T489839.X_REFERENCE_TYPE_CD IN ('Unknown',
                                                            'Unspecified') THEN ''
                       ELSE T489839.X_REFERENCE_TYPE_CD
                   END AS c3,
                   T489839.FST_NAME AS c4,
                           T489839.MID_NAME AS c5,
                                   T489839.LAST_NAME AS c6,
                                           CASE
                                               WHEN CASE
                                                        WHEN NOT substr(T555160.INSTITUTION_FULL_NAME , 1, 3) IN ('WDK',
                                                                                                                  'WFI',
                                                                                                                  'WNO',
                                                                                                                  'WSE') THEN T555160.INSTITUTION_FULL_NAME
                                                        ELSE ''
                                                    END = 'M Hemadress' THEN ''
                                               ELSE CASE
                                                        WHEN NOT substr(T555160.INSTITUTION_FULL_NAME , 1, 3) IN ('WDK',
                                                                                                                  'WFI',
                                                                                                                  'WNO',
                                                                                                                  'WSE') THEN T555160.INSTITUTION_FULL_NAME
                                                        ELSE ''
                                                    END
                                           END AS c7,
                                           CASE
                                               WHEN CASE
                                                        WHEN NOT substr(T555160.INSTITUTION_NAME , 1, 3) IN ('WDK',
                                                                                                             'WFI',
                                                                                                             'WNO',
                                                                                                             'WSE') THEN T555160.INSTITUTION_NAME
                                                        ELSE ''
                                                    END = 'M Hemadress' THEN ''
                                               ELSE CASE
                                                        WHEN NOT substr(T555160.INSTITUTION_NAME , 1, 3) IN ('WDK',
                                                                                                             'WFI',
                                                                                                             'WNO',
                                                                                                             'WSE') THEN T555160.INSTITUTION_NAME
                                                        ELSE ''
                                                    END
                                           END AS c8,
                                           T555160.ADDR AS c9,
                                                   T555160.ZIPCODE AS c10,
                                                           T555160.CITY AS c11,
                                                                   T555160.NAME AS c12,
                                                                           T555160.PH_NUM AS c13,
                                                                                   CASE
                                                                                       WHEN T489839.X_COUNTY = 'Unspecified' THEN ''
                                                                                       ELSE T489839.X_COUNTY
                                                                                   END AS c14,
                                                                                   T555160.NN_PRIMARY AS c15,
                                                                                           T489839.X_External_ID AS c16,
                                                                                                   count(DISTINCT T36044.INTEGRATION_ID) AS c17
    FROM WC_WRK_SPEC_F T565813,
         WC_CUST_ADDR_D T555160,
         W_PERSON_D T489839 /* Custom Contact Dim_W_PERSON_D_Contact */, WC_CUST_INST_F T565669,
                                                                         W_PERSON_D T36044,
                                                                         W_PER_RANK_F T445248 /* Fact_W_PER_RANK_F */
    WHERE (T445248.CONTACT_WID = T565813.CONTACT_WID
           AND T36044.ROW_WID = T445248.CONTACT_WID
           AND T445248.CONTACT_WID = T489839.ROW_WID
           AND T489839.ROW_WID = T555160.CONTACT_WID
           AND T489839.ROW_WID = T565669.CONTACT_WID
           AND T489839.EMP_FLG = 'N'
           AND T489839.X_BU_NAME = 'NNEU Sweden'
           AND T555160.ACTIVE_FLG = 'Y'
           AND T555160.MAIN_ADDR_FLG = 'Y'
           AND T555160.COUNTRY = 'Sweden'
           AND T565813.WRK_SPECIALITY = '01 Allm��Allm��edicin'
           AND (T565669.X_REL_TYPE_CD IN ('Ass Spe',
                                          'AssDist Health C',
                                          'Dis Health C Ctr',
                                          'DisHealth C Ctr',
                                          'DistHealth C',
                                          'Distr Healt Ch',
                                          'District Health',
                                          'Graduate physician',
                                          'Home Health Care Physician',
                                          'Spe RecSenior',
                                          'SpeRecep',
                                          'SpeRecSen',
                                          'SpeRecSpec'))
           AND (T489839.VIS_PR_BU_ID IN ('1-A30BR',
                                         '1-A37AL',
                                         '1-B67SM',
                                         '1-DEN82',
                                         'Unspecified'))
           AND T489839.INTEGRATION_ID IN
             (SELECT DISTINCT SASUBWITH0.c1 AS c1
              FROM SASUBWITH0))
    GROUP BY T489839.FST_NAME, T489839.MID_NAME, T489839.LAST_NAME, T489839.SUPPRESS_MAIL_FLG, T489839.X_External_ID , T555160.NN_PRIMARY, T555160.NAME, T555160.ZIPCODE, T555160.ADDR, T555160.CITY, T555160.PH_NUM, CASE
                                                                                                                                                                                                                          WHEN T489839.JOB_TITLE = 'Unspecified' THEN ''
                                                                                                                                                                                                                          ELSE T489839.JOB_TITLE
                                                                                                                                                                                                                      END , CASE
                                                                                                                                                                                                                                WHEN T489839.X_REFERENCE_TYPE_CD IN ('Unknown',
                                                                                                                                                                                                                                                                     'Unspecified') THEN ''
                                                                                                                                                                                                                                ELSE T489839.X_REFERENCE_TYPE_CD
                                                                                                                                                                                                                            END , CASE
                                                                                                                                                                                                                                      WHEN T489839.X_COUNTY = 'Unspecified' THEN ''
                                                                                                                                                                                                                                      ELSE T489839.X_COUNTY
                                                                                                                                                                                                                                  END , CASE
                                                                                                                                                                                                                                            WHEN CASE
                                                                                                                                                                                                                                                     WHEN NOT substr(T555160.INSTITUTION_NAME , 1, 3) IN ('WDK',
                                                                                                                                                                                                                                                                                                          'WFI',
                                                                                                                                                                                                                                                                                                          'WNO',
                                                                                                                                                                                                                                                                                                          'WSE') THEN T555160.INSTITUTION_NAME
                                                                                                                                                                                                                                                     ELSE ''
                                                                                                                                                                                                                                                 END = 'M Hemadress' THEN ''
                                                                                                                                                                                                                                            ELSE CASE
                                                                                                                                                                                                                                                     WHEN NOT substr(T555160.INSTITUTION_NAME , 1, 3) IN ('WDK',
                                                                                                                                                                                                                                                                                                          'WFI',
                                                                                                                                                                                                                                                                                                          'WNO',
                                                                                                                                                                                                                                                                                                          'WSE') THEN T555160.INSTITUTION_NAME
                                                                                                                                                                                                                                                     ELSE ''
                                                                                                                                                                                                                                                 END
                                                                                                                                                                                                                                        END , CASE
                                                                                                                                                                                                                                                  WHEN CASE
                                                                                                                                                                                                                                                           WHEN NOT substr(T555160.INSTITUTION_FULL_NAME , 1, 3) IN ('WDK',
                                                                                                                                                                                                                                                                                                                     'WFI',
                                                                                                                                                                                                                                                                                                                     'WNO',
                                                                                                                                                                                                                                                                                                                     'WSE') THEN T555160.INSTITUTION_FULL_NAME
                                                                                                                                                                                                                                                           ELSE ''
                                                                                                                                                                                                                                                       END = 'M Hemadress' THEN ''
                                                                                                                                                                                                                                                  ELSE CASE
                                                                                                                                                                                                                                                           WHEN NOT substr(T555160.INSTITUTION_FULL_NAME , 1, 3) IN ('WDK',
                                                                                                                                                                                                                                                                                                                     'WFI',
                                                                                                                                                                                                                                                                                                                     'WNO',
                                                                                                                                                                                                                                                                                                                     'WSE') THEN T555160.INSTITUTION_FULL_NAME
                                                                                                                                                                                                                                                           ELSE ''
                                                                                                                                                                                                                                                       END
                                                                                                                                                                                                                                              END
    ORDER BY c1,
             c2,
             c3,
             c4,
             c5,
             c6,
             c7,
             c8,
             c9,
             c10,
             c11,
             c12,
             c13,
             c14,
             c15,
             c16
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.83       0.82          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.77       5.33      11613      11625          0           0
    total        3      1.60       6.16      11613      11625          0           0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 52 
    Rows     Row Source Operation
          0  SORT GROUP BY (cr=11625 pr=11613 pw=0 time=5339293 us)
          0   VIEW  (cr=11625 pr=11613 pw=0 time=5339234 us)
          0    HASH GROUP BY (cr=11625 pr=11613 pw=0 time=5339226 us)
          0     HASH JOIN  (cr=11625 pr=11613 pw=0 time=5339089 us)
          0      NESTED LOOPS  (cr=11625 pr=11613 pw=0 time=5337767 us)
          0       HASH JOIN  (cr=11625 pr=11613 pw=0 time=5337762 us)
          0        NESTED LOOPS  (cr=11625 pr=11613 pw=0 time=5337565 us)
          0         HASH JOIN  (cr=11625 pr=11613 pw=0 time=5337561 us)
          0          HASH JOIN  (cr=11625 pr=11613 pw=0 time=5337376 us)
          0           HASH JOIN  (cr=11625 pr=11613 pw=0 time=5337192 us)
          0            TABLE ACCESS FULL WC_WRK_SPEC_F (cr=11625 pr=11613 pw=0 time=5336958 us)
          0            NESTED LOOPS  (cr=0 pr=0 pw=0 time=0 us)
          0             NESTED LOOPS  (cr=0 pr=0 pw=0 time=0 us)
          0              HASH JOIN  (cr=0 pr=0 pw=0 time=0 us)
          0               TABLE ACCESS BY INDEX ROWID W_PERSON_D (cr=0 pr=0 pw=0 time=0 us)
          0                BITMAP CONVERSION TO ROWIDS (cr=0 pr=0 pw=0 time=0 us)
          0                 BITMAP AND  (cr=0 pr=0 pw=0 time=0 us)
          0                  BITMAP OR  (cr=0 pr=0 pw=0 time=0 us)
          0                   BITMAP INDEX SINGLE VALUE IXDIM_W_PERSON_D_F27 (cr=0 pr=0 pw=0 time=0 us)(object id 348198)
          0                   BITMAP INDEX SINGLE VALUE IXDIM_W_PERSON_D_F27 (cr=0 pr=0 pw=0 time=0 us)(object id 348198)
          0                   BITMAP INDEX SINGLE VALUE IXDIM_W_PERSON_D_F27 (cr=0 pr=0 pw=0 time=0 us)(object id 348198)
          0                   BITMAP INDEX SINGLE VALUE IXDIM_W_PERSON_D_F27 (cr=0 pr=0 pw=0 time=0 us)(object id 348198)
          0                   BITMAP INDEX SINGLE VALUE IXDIM_W_PERSON_D_F27 (cr=0 pr=0 pw=0 time=0 us)(object id 348198)
          0                  BITMAP INDEX SINGLE VALUE W_PERSON_D_M14 (cr=0 pr=0 pw=0 time=0 us)(object id 250911)
          0               NESTED LOOPS  (cr=0 pr=0 pw=0 time=0 us)
          0                TABLE ACCESS FULL WC_WRK_SPEC_F (cr=0 pr=0 pw=0 time=0 us)
          0                BITMAP CONVERSION TO ROWIDS (cr=0 pr=0 pw=0 time=0 us)
          0                 BITMAP INDEX SINGLE VALUE W_PER_RANK_F_F7 (cr=0 pr=0 pw=0 time=0 us)(object id 642169)
          0              TABLE ACCESS BY INDEX ROWID W_PERSON_D (cr=0 pr=0 pw=0 time=0 us)
          0               INDEX RANGE SCAN W_PERSON_D_U1 (cr=0 pr=0 pw=0 time=0 us)(object id 250907)
          0             BITMAP CONVERSION TO ROWIDS (cr=0 pr=0 pw=0 time=0 us)
          0              BITMAP INDEX SINGLE VALUE W_PER_RANK_F_F7 (cr=0 pr=0 pw=0 time=0 us)(object id 642169)
          0           TABLE ACCESS FULL WC_CUST_INST_F (cr=0 pr=0 pw=0 time=0 us)
          0          TABLE ACCESS FULL WC_CUST_INST_F (cr=0 pr=0 pw=0 time=0 us)
          0         INDEX UNIQUE SCAN W_PERSON_D_P1 (cr=0 pr=0 pw=0 time=0 us)(object id 250906)
          0        TABLE ACCESS BY INDEX ROWID WC_CUST_ADDR_D (cr=0 pr=0 pw=0 time=0 us)
          0         BITMAP CONVERSION TO ROWIDS (cr=0 pr=0 pw=0 time=0 us)
          0          BITMAP AND  (cr=0 pr=0 pw=0 time=0 us)
          0           BITMAP INDEX SINGLE VALUE IXDIM_WC_CUST_ADDR_D_F07 (cr=0 pr=0 pw=0 time=0 us)(object id 251281)
          0           BITMAP INDEX SINGLE VALUE IXDIM_WC_CUST_ADDR_D_F06 (cr=0 pr=0 pw=0 time=0 us)(object id 251285)
          0           BITMAP INDEX SINGLE VALUE IXDIM_WC_CUST_ADDR_D_F05 (cr=0 pr=0 pw=0 time=0 us)(object id 251287)
          0       TABLE ACCESS BY INDEX ROWID W_PERSON_D (cr=0 pr=0 pw=0 time=0 us)
          0        INDEX UNIQUE SCAN W_PERSON_D_P1 (cr=0 pr=0 pw=0 time=0 us)(object id 250906)
          0      VIEW  index$_join$_003 (cr=0 pr=0 pw=0 time=0 us)
          0       HASH JOIN  (cr=0 pr=0 pw=0 time=0 us)
          0        HASH JOIN  (cr=0 pr=0 pw=0 time=0 us)
          0         BITMAP CONVERSION TO ROWIDS (cr=0 pr=0 pw=0 time=0 us)
          0          BITMAP INDEX SINGLE VALUE IXDIM_WC_CUST_ADDR_D_F07 (cr=0 pr=0 pw=0 time=0 us)(object id 251281)
          0         BITMAP CONVERSION TO ROWIDS (cr=0 pr=0 pw=0 time=0 us)
          0          BITMAP INDEX SINGLE VALUE IXDIM_WC_CUST_ADDR_D_F04 (cr=0 pr=0 pw=0 time=0 us)(object id 251288)
          0        BITMAP CONVERSION TO ROWIDS (cr=0 pr=0 pw=0 time=0 us)
          0         BITMAP INDEX FULL SCAN IXDIM_WC_CUST_ADDR_D_F02 (cr=0 pr=0 pw=0 time=0 us)(object id 251276)
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.83       0.82          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.77       5.33      11613      11625          0           0
    total        3      1.60       6.16      11613      11625          0           0
    Misses in library cache during parse: 1
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse       11      0.00       0.00          0          0          0           0
    Execute    113      0.02       0.03          0          0          0           0
    Fetch      253      0.01       0.08         15        411          0         999
    total      377      0.05       0.13         15        411          0         999
    Misses in library cache during parse: 8
    Misses in library cache during execute: 8
        1  user  SQL statements in session.
      112  internal SQL statements in session.
      113  SQL statements in session.
    Trace file: p002_ora_32614_MY_TEST_SESSION02.trc
    Trace file compatibility: 10.01.00
    Sort options: prsela  exeela  fchela 
           0  session in tracefile.
           1  user  SQL statements in trace file.
         112  internal SQL statements in trace file.
         113  SQL statements in trace file.
          12  unique SQL statements in trace file.
        1292  lines in trace file.
          12  elapsed seconds in trace file.

  • Running a java program a set number of times

    This is a general question. Is it possible to make a java program run only 5 times for the sake of arguement.
    Basically I want to write a program that will give the user some flexibility when it will actually run another Java program, but I only want them to be able to say "not now' for a set number of times. When the last time comes the other program will launch. I was initially thinking of the Do Whilw loop, but this needs to work when the program is restarted.
    Program starts, it has 5 times it will run before it does something else(doesn't really matter now I think). User takes option "Not Now" and the program ends, but warns the user this will run 4 more times before you will need to do something.
    This process will repeat until the user takes the option "Ok install now" or the time limit expires and the install occurs anyway. Can someone point me in the right direction.

    ok I see so it's like one those programs that you download for free on the internet and they give you a set amount times to use it before you have to pay for it. but in this case when the number of times you use it equals 5 (or when the user clicks ok) a different java app will open automatically.
    My first thought would be to Write a Serialized object to disk using objectOutputStream that stores the number of times the application has been opened. and each time the program runs it checks for the serialized object and then you can do something like what I posted before. of course if were worried about security the user could always look for the object and erase it, if so then I guess we would have to come up with another plan of attack
    Hope this helps

  • Query takes long time 41 seconds to run how to tune

    my query is simple as follows...i dont know how to tune it..
    cur_memb_count (p_as_of_date IN date)
    is
    select
    count(ip.individual_id) membercount,
    --lpad(re.region_id,2,'0')||lpad('000',3,'0')||lpad( pb.plan_cd,3,'0') group_id,
    substr(pb.plan_cd,1,1)||lpad(re.region_id, 2,'0')||'0000' group_id,
    ipp.legal_entity_id,
    bus.gl_bus_unit_a,
    bus.lob,
    loc.gl_loc_nbr_a,
    prod.gl_product_cd_a,
    prod.gl_fin_argmt_a,pb.plan_type_id ,pb.plan_cd
    from
    plan pb ,region_map re , state_plan_billing spb,
    insured_plan_profile ipp , insured_plan ip ,
    ods.oods_gl_bus_unit bus, ods.oods_gl_loc_nbr loc,
    ods.oods_gl_product_line prod,
    household h,
    employer_household eh
    where
    ipp.residence_st_plan_billing_id = spb.state_plan_billing_id
    and ipp.insured_plan_id = ip.insured_plan_id
    and ip.plan_cd = pb.plan_cd
    and pb.plan_cd=spb.plan_cd
    -- and pb.plan_type_id = loc.lob
    and spb.state_cd = re.state_cd
    and p_as_of_date between ip.insured_plan_effective_date and
    nvl(ip.insured_plan_termination_date,'31-dec-9999')
    and ip.insured_plan_effective_date <>
    nvl(ip.insured_plan_termination_date,'31-dec-9999')
    -- the condition below is necessary. but not enough data to test.when
    uncommented will only give
    -- a few records. try testing it just by uncommenting it.
    --and p_as_of_date between re.region_map_start_date and re.region_map_stop_date
    and loc.lob=prod.lob and loc.lob=bus.lob(+) and loc.company_cd=bus.company_cd(+)
    and p_as_of_date between pb.plan_start_date and pb.plan_stop_date
    and p_as_of_date between ipp.ins_plan_profile_start_date and
    ipp.ins_plan_profile_stop_date
    -- and lpad(re.region_id,2,'0')||lpad('000',3,'0')||lpad(pb.plan_cd,3,'0')
    = loc.group_id
    and substr(pb.plan_cd,1,
    1)||lpad(re.region_id,2,'0')||nvl(employee_id,'0000') =loc.group_id
    and p_household_id_param = h.household_id
    and h.household_id = eh.employer_household_id
    and p_date_param between eh.emp_hhold_start_date and eh.emp_hhold_stop_date
    and insplan.individual_id=housmemb.individual_id(+)
    and eh.delete_ind = 'N'
    group by
    --lpad(re.region_id,2,'0')||lpad('000',3,'0')||lpad(pb.plan_cd,3,'0'),
    substr(pb.plan_cd ,1,1)||lpad(re.region_id,2, '0')||nvl(employee_id,'0000'),

    If many full table scans on big tables consider creating indexes. Or if many index reads consider forcing full table scans :)
    Ah, I just love these tuning questions. "My query is slow. Please make it go fast". Sure, put on these red shoes, click your heels three times and make a wish. Alas, tuning is rather more complicated than that, more of a science than a voodoo rirtual. We would like to help. But we need more data, some concrete figures. Otherwise we're just guessing.
    So, first off, please read the Performance Tuning Guide. Apply some of its techniques. If you still don't understand why your query is running slow, come back to us with table descriptions, volumetrics, indexes, explain plans, stats, timings and tkprof output.
    Good luck, APC

  • "I am constantly getting a message which says Itunes cannot run because some of it's required files are missing.  Please reinstall iTunes."  I've reinstalled a number of times and re-booted but it only seems to last a short time.  How do I fix it?

    I am constantly getting a message which says "iTunes cannot run because some of it's required files are missing.  Please reinstall iTunes."  I've reinstalled a number of times and re-booted but it only seems to last a short time.  How do I fix it?

    HI daddio,
    Ok some things first I need to know...Did you use Microsoft cleanup utility to clean up all those uninstalls you have done?
    I hate Norton and anyone who reads my posts will know that. I have seen way too many infected PC's by Norton users. Did you try the EWIDO and AdAware scan? I see you said you read lots of posts. That is helping folks remove the malware in order to get iTunes and quicktime back to health.

  • QUERY WHICH COUNTS NUMBER OF TIMES WORDS/LETTER APPEAR IN SENTENCE - Thanks

    I have this query below
    it gives the number of times a txn is hign comfort and Approved
    .. nyumber of times txn is meduim comfort and approved etc.
    There is a futher line whihc shows the number of times txn is blacklisted BL COUNT.
    I am trying to get line of query which can show me the number of times txn is approved, is high comfort and blcklisted ( the same applies for
    wl - watch listed)
    The query i am using
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('BL(%') and cc.Comment
    LIKE ('Approved%')
    AND cc.Comment
    LIKE ('%ComfortLevel=High Comfort%')
     THEN 1
    ELSE 0 END)AS hbcl  - NO RESULTS BEING GIVEN
    pLEASE CAN ANYONE HELP,. THANKS
    QUERY
    USE RiskManagementReporting
    GO
    DECLARE
    @StartDate DATETIME,
    @EndDate DATETIME
    SET @StartDate
    = '2014-01-01 00:00:00'
    SET @EndDate
    = '2014-03-31 23:59:59'
    SELECT
    CONVERT
    (VARCHAR(10),
    mt.OPacket_TransactionTime, 102)
    AS [Date],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Approved%')
    AND cc.Comment
    LIKE ('%ComfortLevel=High Comfort%')
    THEN 1 ELSE 0
    END) AS [A - HighC],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Approved%')
    AND cc.Comment
    LIKE ('%ComfortLevel=Medium Comfort%')
    THEN 1 ELSE 0
    END) AS [A - MediumC],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Approved%')
    AND cc.Comment
    LIKE ('%ComfortLevel=Low Comfort%')
    THEN 1 ELSE 0
    END) AS [A - LowC],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Declined%')
    AND cc.Comment
    LIKE ('%ComfortLevel=Low Risk%')
    THEN 1 ELSE 0
    END) AS [D - LowR],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Declined%')
    AND cc.Comment
    LIKE ('%ComfortLevel=Medium Risk%')
    THEN 1 ELSE 0
    END) AS [D - MediumR],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Declined%')
    AND cc.Comment
    LIKE ('%ComfortLevel=High Risk%')
    THEN 1 ELSE 0
    END) AS [D - HighR],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('BL(%')
    THEN 1 ELSE 0
    END) AS [BL Count],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('WL(%')
    THEN 1 ELSE 0
    END) AS [WL Count],
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Marked as Touched%')
    THEN 1 ELSE 0
    END) AS [Touched by DRT],
    COUNT
    (mt.csnTransactionId)
    AS [Sent to DRT]
    FROM MatchedTransaction mt
    WITH (NOLOCK)
    LEFT
    JOIN CustomerComment cc
    WITH (NOLOCK)
    ON (mt.csnTransactionId
    = cc.SenderMTCN
    AND cc.InsertDate
    BETWEEN @StartDate AND
    DATEADD (D, 1, @EndDate)

    I have adjusted this as  
    SUM
    (CASE
    WHEN cc.Comment
    LIKE ('Approved%')
    AND cc.Comment
    LIKE ('%ComfortLevel=High Comfort%')
    AND cc.Comment
    LIKE ('%BL(%')THEN 1
    ELSE 0 END)
    AS hcbl,
    Still no result

  • How to set vo query at run time

    Hi,
    Is it possible to bind the where clause of query at run time.
    N :)

    Hi,
    Yes its possible.
    To add new where clause to your query.
    vo.setWhereClause(null);//If you want to remove any existing programmatically added where clause.
    vo.setWhereClause("Your new query");
    To bind varibales (Say there are 2 bind variables),
    First way to achieve this.
    setWhereClauseParam(null); //Always reset it to remove existing bindings)
    setWhereClauseParam(0, "Your first paramter value"); // Second parameter "Your first paramter value" is of type object.
    setWhereClauseParam(1, "Your first paramter value");
    In case you use "?" styly type binding, this count in above method starts with 1 instead of 0.
    Second way is to put all bind variables in an object array and pass to above method.
    Vector params=new Vector(2);
    params.addElement("FirstParameter");
    params.addElement("SecondParameter");
    Now call vo.executeQuery() to fetch the results as per new query.
    Abdul Wahid

  • Thread Running negative number of time.

    Hi All,
    I wrote a program to check the effects of Thread priority, however to my surprise the output is weired the higher priority thread shows that it run negative number of time, below is the code.
    package javaProg.completeReferance;
    class Clicker implements Runnable
         Thread t;
         int click;
         volatile boolean  running = true;
         public Clicker(int pro)
              t=new Thread(this);
              click = 0;
              t.setPriority(pro);
         public void run()
              while (running)
                   click++;
         public void start()
              t.start();
         public void stop()
              running=false;
    public class TestClicker
         public static void main(String [] args)
              Clicker thread1 = new Clicker(Thread.NORM_PRIORITY+2);
              Clicker thread2= new Clicker(Thread.NORM_PRIORITY-2);
              thread1.start();
              thread2.start();
              System.out.println("Processing");
              try
                   Thread.sleep(10000);
              catch (InterruptedException i)
                   System.out.println(i);
              thread1.stop();
              thread2.stop();
              try
                   thread1.t.join();
                   thread2.t.join();
              catch (InterruptedException i)
                   System.out.println(i);
              System.out.println("The number of Time Thread1 executed is "+thread1.click);
              System.out.println("The number of time Thread2 executed is "+thread2.click);
    }Here is the Output..
    C:\Users\pravin>java javaProg.completeReferance.TestClicker
    Processing
    The number of Time Thread1 executed is -386946835
    The number of time Thread2 executed is 837375311Thanks!!

    Thanks a lot , I changed int click to long and its
    working fine.I am wondering why the Java Platform
    didnt throw an error or exception for overflow.Because the Java specification calls for it not to do that but instead to do what you saw and rollover.

  • How to get report (SQL Query) generating Run Time

    There is a Standard report of Payroll which show employee transfer information on the bases of location, grade job or organization, now to get actual query which is generated by run time in report builder including whether single column parameter or lexical parameter " because currently the query in not complicate but the parameter and lexical parameter is much more due to this not quite easy to under stand just copy past it into toad or pl/sql developer,
    Kindly share your experience to get such kind of query in you working time.
    thanks

    Here i try to explain contain of query.
    Parameter
    P_DEPTNO = 10
    P_WHERE_CLAUSE := ' AND EMPNO IS NOT NULL AND SALARY > 100'
    SELECT * FROM EMP
    WHERE DEPTNO = P_DEPTNO
    &P_WHERE_CLAUSE
    REPROT WILL GENERATE QUERY AT RUN TIME IS LIKE THAT
    SELECT * FROM EMP
    WHERE DEPTNO = 10
    AND EMPNO IS NOT NULL AND SALARY > 100
    Now i want to get this query out(Run time) by doing any oracle database feature or sth similar.
    thanks

  • The query just run the first time, the second doesnt run

    The query just run the first time, the second doesnt run, i checked it in the SM50 and appear this msg:
    CL_RSR_CACHE_BO_FF============CP
    its not a problem of indexes, i repaired it but its really weird cause the first time the query run ok, the second doesnt, it seems that the cache is confused or i dont know, help guys, i'll really appreciate it

    I was watching the notes, its really weird when i load the cube and execute the query for the first time, its ok, to the second stay in cache, but i was watching that the cube doesnt allow me activat the BD statistics, i dont know if this is necesary to improve the performance of the query, what i know is this:
    1- before i create a Hierarchy for an infoobject thta is in the cube ,  the query used to run ok. Now when i load the first time and execute its ok, but the second stay in cache.
    2- now i can activate the statistics for the cube, the indexes are ok, i checked for the RSRV and all is ok less the statistics.
    what can i do help friends...

  • I have Lightroom 3 and have installed it on my Retina iMac running Yosemite. It will not show me any of the modules..error when attempting to change modules.. and keeps asking for my serial number every time. Is it compatible?

    I have Lightroom 3 and have installed it on my Retina iMac running Yosemite. It will not show me any of the modules..error when attempting to change modules.. and keeps asking for my serial number every time. Is it compatible?
    David

    This is a duplicate thread - see here

Maybe you are looking for