Need a power-Cli report which shows pools of resources, including CPU, memory, reviews, DS, VM, VMDK files into a CSV file.

Hi LucD

I'm looking for a script more which is basically watch resources pools which s VM CPU, memory, comments, DS or files VMDK into a CSV file instead of the HTML resource pool file. Could you please help me on this.

Your help would be very appreciated!

Thank you.

Nauman

Try like this, it will produce 1 CSV file with all the information.

$report = @)

{foreach ($cluster Get-cluster)

foreach ($rp in Get-ResourcePool-location $cluster) {}

foreach ($vm in (Get-VM-location the $rp)) {}

$report += get-disk hard - VM $vm |

Select @{N = "Cluster"; E = {$cluster. Name}},

@{N = "ResourcePool"; E = {$rp. Name}},

@{N = "VM"; E = {$vm. Name}},

@{N = 'HD'; E={$_. Name}},

@{N = "Datastore"; E={($_. Filename.Split(']') [0]). TrimStart('[')}},

@{N = 'Filename'; E={($_. Filename.Split('_') [1]). "Split('/') [0]}},"

@{N = 'Path VMDK'; E={$_. File name}}.

@{N = "Format"; E={$_. StorageFormat}},

@{N = ' Type'; E={$_. DiskType}},

@{N = "CapacityGB"; E={$_. CapacityGB}}

}

}

}

$report | Export Csv report.csv - NoTypeInformation - UseCulture

Tags: VMware

Similar Questions

  • Need a power-Cli report which shows pools of resources, including CPU, memory, reviews, DS, VM, VMDK files in an HTML report.

    LucD

    Hi LucD,

    I'm working on a script that is basically a lot of information on the whole cloud (including several clusters). The information I need is like that

    Script creates a format of report (in HTML) of the resource pool, and each report represents a single pool that contains information of CPU, Mem, comments, warehouses of data, use the data store VMDK files and free space. We fundamentally need this information in order to understand the use of the customer as each pool represents each client.

    Could you please help me out on this then that would be great . Thank you. in advance.

    Nauman

    OK, added a line with the VMDK file name.

    $a = "$name"

    $a = $a +""

    {foreach ($cluster Get-cluster)

    foreach ($rp in Get-ResourcePool-location $cluster) {}

    $report = foreach ($vm in (Get-VM-location the $rp)) {}

    Get-disk hard - VM $vm |

    Select @{N = "Cluster"; E = {$cluster. Name}},

    @{N = "ResourcePool"; E = {$rp. Name}},

    @{N = "VM"; E = {$vm. Name}},

    @{N = 'HD'; E={$_. Name}},

    @{N = "Datastore"; E={($_. Filename.Split(']') [0]). TrimStart('[')}},

    @{N = 'Filename'; E={($_. Filename.Split('_') [1]). "Split('/') [0]}},"

    @{N = 'Path VMDK'; E={$_. File name}}.

    @{N = "Format"; E={$_. StorageFormat}},

    @{N = ' Type'; E={$_. DiskType}},

    @{N = "CapacityGB"; E={$_. CapacityGB}}

    }

    $report | ConvertTo-Html-head $a | Out-file - FilePath "C:\temp\$ (cluster$.). (Name) - $($rp.) "(Name) - report.html.

    }

    }

  • Needs of report to show all columns

    Hello, I have two interactive reports on two different pages, and I'm unable to show all columns. It will automatically appear all the columns. I know that I can show them all with Actions / Select the columns / > >, but I can't expect all of my users to do each time that they reopen the browser. They want that search the IRs without pressing Actions each time.

    In my 1st report, I just a column of money, but it will not appear automatically. How can I get the GAL_PUMPED to automatically display column without using the Actions menu each time?

    SELECT UFT.SITE_NUM, UFT.TANK, UFT.FUEL_TYPE, sum(UFT.GALLONS) GAL_PUMPED
    FROM  futrak.FUEL_TRANSACTIONS  UFT
    WHERE to_char(UFT.TRAN_DATE,'MON-YYYY') < to_char(SYSDATE,'MON-YYYY')
    GROUP BY UFT.SITE_NUM, UFT.TANK, UFT.FUEL_TYPE
     

    In my 2nd report, only columns of fth automatically, will not display the columns of ftd. How all the columns in the two tables to automatically display without the Actions menu each time? Also, the unit is supposed to be the last column, but this problem makes the 3rd column after using select columns. I'm stuck with APEX 4.0 and may not use plugins, but I want to hack everything that will help solve this problem. I'd appreciate any help or advice, thank you.

    SELECT fth.SITE_NUM, fth.TANK, sum(ftd.GALLONS), ftd.FLEET_ID, ftd.EXPENSE_TO_PROJECT, ftd.EXPENSE_TO_TASK, fth.UNIT_NUM
    FROM FUEL_USAGE_HEADER fth,
      FUEL_USAGE_DETAIL ftd
    WHERE 
      fth.FUEL_USAGE_ID = ftd.FUEL_USAGE_ID
    AND fth.PROCESSED_DATE is null 
    AND to_char(fth.TRANSACTION_DATE,'MON-YYYY') < to_char(SYSDATE,'MON-YYYY')
    GROUP BY fth.SITE_NUM, fth.TANK ,ftd.FLEET_ID, ftd.EXPENSE_TO_PROJECT, ftd.EXPENSE_TO_TASK, fth.UNIT_NUM
    order by 1
     

    Display all Columns.png

    Login to your application as a developer when running. Modify the report in the way that your users need. Save the report, select "default report parameters.

  • I paid for the pack of adobe PDF and I in some weird screen which shows the different products to buy. I just want to use the pdf pack to do what I need. any suggestions?

    I paid for the pack of adobe PDF and I in some weird screen which shows the different products to buy. I just want to use the pdf pack to do what I need. any suggestions?

    Hi jerrir58650452,

    You can access your service pack pdf by using the following link: https://cloud.acrobat.com

    Kind regards
    Rahul

  • Power for reports CLI script

    Hello

    IAM again to scripts. IAM trying to create script for the assignment and usage report. This report, I need to generate every 15th and 1st of each month how to generate in microsoft excel. Put it there NOMCLUSTER, hostname ESX, VMname, VM IP address, Note, allocated CPU, allocated memory (GB), allocated disk, use (%) AVG CPU and memory use (%) Avg.

    Please guide me to create this script. IAM doing these mannuly report which is takeing 4 hours time. I want to learn automatically reports creation and scripting.

    Please help me.

    Thank you

    Victor

    Looks like you're missing the first line that says:

    $start = [datetime]"1 sep 2011"
    

    Maybe something went wrong in the copy/paste.

    I have attached the script in all cases.

  • Need to extract orders in report which are rejected in choose release

    Hello

    We have an obligation to a customer, enter orders in the report, which are failed during the process of release of levy and to identify the reason.

    The sequence will be as follows: (during opening hours)

    1. run the Plan of levy for the day (custom)
    2 do run on demand 'Release sales order-SRS' standard programme with collection of rule
    3. run our custom report to capture records failed in step 2 with the reason for the failure.

    Is that any body has any standard report available for this requirement or you report customization, please share the details and queries.

    Thank you
    PAKER

    You can use the summary report of out of stock

    The synthesis of out of stock report displays a list of all orders not shipped and includes
    orders under an order cycle which includes take exit.

    You can customize according to your needs.

    HTH
    Mahendra

  • How to calculate the space needed to move a member to another pool?

    Dear,

    We move - Member3 - member to a pool of maintenance for the upgrade of the firmware.

    My question is how can we calculate the space needed to move a member to another pool?

    I have attached some pictures of SANHQ for the pool/ability/member of the group.

    PS To consider space group not the pool area, because we have a fourth demo maintenance pool member and we it will move to the default pool for the process of upgrade only.

    Kind regards

    Turki

    Try this:

    GrpName > show Member - poolinfo
    Name State Version discs capacity FreeSpace connections pool
    ---------- ------- ---------- ----- ---------- ---------- ----------- -------
    Virt2-Mem2 V6.0.6 (R3 16 6.8 TB TB 5.53 208 ActiveP online
    51932)                                             ool
    Virt2-Mem3 V6.0.6 (R3 16 6.8 TB TB 5.95 Alterna 36 online
    51932)                                             tePoo
    l
    Virt2-Mem1 V6.0.6 online (R3 16 23.08(a) TB TB 21.44 209 ActiveP
    51932)                                             ool

    Re: cancel the mapping.  Some points to remember.  Cancel the MAPPING does not work on the replicated volumes, it's either sync replication or point-in-time standard.   Also according to the file system, it will not immediately reclaim the unused space on existing volumes.   Some file systems like VMware VMFS does not cancel the map on the fly, but offer a CLI utility to create large balloon files then delete and send him UNMAP commands simultaneously.

    The basic rule is that you must have enough space to move the member selected out of the pool.   If this isn't the case, then the operation will not be allowed.  You may end up having to add the new Member to the pool until you can move a table.

    Note: If you do not already done, then the site of Equallogic, with FW downloads is a document that describes how to set the value of disktimeout for several OS.   This allows the host (or the guest virtual machines) to cross the short breakdown during a firmware update or a failover of controllers due to a failure of the CM.

    Kind regards

  • Compare the report not showing the changes

    I modified an app engine select commenting on a line. I then did a report compares against a database that do not have the code

    CODE.jpg

    The comparison report shows no difference between the two DB

    What Miss me?

    RPT.jpg

    If you change only the SQL, then you need compare SQL objects. The report you are looking at is only for the engine program of Application objects. This will only show the changes made to the program properties (things like the records of State or temporary tables, attached to the program).

    Another report will show the changes for Application Sections of the engine, which would include things like the addition of new sections, adding or removing a step of a section or changing the properties of a step or a section.

    Also, to see changes made to the Application Engine PeopleCode, you'd have to glance at the Application Engine PeopleCode compare report (note that peoplecode types are detailed in separate reports, but all the SQL types appear in the same report).

    Kind regards

    Bob

  • Need help with powercli report - thin disk

    Hello

    As always, the forums here have given me what I need, and I learned a lot. However my knowledge of script is still not at the level where I can combine all I learned. I would appreciate help.

    Basically, I want to write a report that shows the configuration of each computer drive virtual MORE stocked the size of the disc if the disc is thin.

    Currently, I have the following two pieces of code that run completely separately.

    1 - show me the size committed

    $report = @)
    #$allvms = get - VM
    {foreach ($vm to $allvms)
    $vmview = $vm | Get-View
    foreach ($disk in $vmview. Storage.PerDatastoreUsage) {}
    $dsview = (get-view $disk. Data store)
    $dsview. RefreshDatastoreStorageInfo()

    $row = "" | Select VMNAME DATASTORE, VMSIZE_GB, VMUSED_GB %
    $row. VMNAME = $vmview. Config.Name
    $row. DATA store is $dsview. Name
    $row. VMSIZE_GB = (($disk.Committed+$disk.Uncommitted)/1024/1024/1024)
    $row. VMUSED_GB = (($disk.Committed)/1024/1024/1024)
    $row. P = [int] (($row.)) VMUSED_GB / $row. (VMSIZE_GB) * 100)
    $report += $row
    }
    }
    $report | Out-GridView

    2nd - produces the majority of the report

    $report = @)
    $report = {foreach ($vm to $ALLVMs)
    Get-disk hard $vm | Select @{N = 'The virtual computer name'; E = {$vm. Name}},
    @{N = "RDM Name"; E = {($_ | where {"RawPhysical", "RawVirtual"-contient $_.)} DiskType}). File name}}.
    @{N = 'Data store name'; E = {($_ | where {"RawPhysical", "RawVirtual"-notcontains $_.)} DiskType}). Filename.Split(']') [0]. TrimStart('[')}},
    @{N = 'Name of the HD'; E={$_. Name}},
    @{N = 'Size of HD GiB'; E={$_. CapacityKB/1 MB}},
    @{N = "Format"; E={$_. StorageFormat}},
    @{N = "Clerk disk"; {E = {$_.Committed}}.
    @{N = 'Memory'; E={ }},
    Get - VM $vm | Select @{N = 'Memory'; E = {$vm. MemoryMB}}

    }

    $report | Out-GridView

    Thanks to those who submitted the code above, I changed a bit!

    Ideally, the 2nd report would contain a "Committed disk" column which shows the < committed > according to code 1.

    Any help or pointers gladly accepted.

    Unless you have a 1 vdisk in line with the strategy of the data (as already mentioned Conrad) store, I'm afraid, it's impossible

  • Need advice on SQL report base to APEX or jasper

    Hi all

    I need some advice on how to approach the question under the requirement of report. It was me mad for almost 2 weeks now, and my time is running out.
    Here is a simplified version of the database

    Four paintings: event, Service, commitment, defendant.
    A defendant may have more than 1 commitment, but they only open at a time commitment.
    For each commitment, they will have services and events.
    These events may be just general events or related to the service.
    Here's the script for tables and sample data
    CREATE TABLE "DEFENDANT" 
       ("DEF_ID" NUMBER, 
         "FIRST_NAME" VARCHAR2(50 BYTE), 
         "LAST_NAME" VARCHAR2(50 BYTE), 
         "ACTIVE" NUMBER DEFAULT 1
       ) ;
    Insert into DEFENDANT (DEF_ID,FIRST_NAME,LAST_NAME,ACTIVE) values (1,'Joe','Bloggs',1);
    Insert into DEFENDANT (DEF_ID,FIRST_NAME,LAST_NAME,ACTIVE) values (2,'John','Doe',1);
    --------------------
     CREATE TABLE "ENGAGEMENT" 
       ("ENG_ID" NUMBER, 
         "DEF_ID" NUMBER, 
         "COURT_NAME" VARCHAR2(20 BYTE), 
         "DATE_JOINED" DATE, 
         "DATE_TERMINATED" DATE, 
         "ETHNICITY" VARCHAR2(50 BYTE), 
         "ACTIVE" VARCHAR2(20 BYTE)
       ) ;
    /
    
    Insert into ENGAGEMENT (ENG_ID,DEF_ID,COURT_NAME,DATE_JOINED,DATE_TERMINATED,ETHNICITY,ACTIVE) values (1,1,'AAA',to_date('01/09/12','DD/MM/RR'),to_date('20/09/12','DD/MM/RR'),'European','1');
    Insert into ENGAGEMENT (ENG_ID,DEF_ID,COURT_NAME,DATE_JOINED,DATE_TERMINATED,ETHNICITY,ACTIVE) values (2,2,'BBB',to_date('01/10/12','DD/MM/RR'),null,'Asian','1');
    Insert into ENGAGEMENT (ENG_ID,DEF_ID,COURT_NAME,DATE_JOINED,DATE_TERMINATED,ETHNICITY,ACTIVE) values (3,1,'AAA',to_date('22/09/12','DD/MM/RR'),null,'European','1');
    -------------------------------------------------------- 
     CREATE TABLE "EVENT" 
       ("EVENT_ID" NUMBER, 
         "ENG_ID" NUMBER, 
         "NOTES" VARCHAR2(20 BYTE), 
         "RELATED_SERVICE_ID" NUMBER, 
         "START_DATE" DATE, 
         "END_DATE" DATE, 
         "ACTIVE" NUMBER DEFAULT 1
       ) ;
    /
    --------------------------------------------------------
    Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (1,1,null,1,to_date('01/09/12','DD/MM/RR'),to_date('02/09/12','DD/MM/RR'),1);
    Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (2,1,null,1,to_date('23/09/12','DD/MM/RR'),null,1);
    Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (3,1,null,2,to_date('15/10/12','DD/MM/RR'),to_date('16/10/12','DD/MM/RR'),1);
    Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (4,2,null,null,to_date('02/10/12','DD/MM/RR'),null,1);
    Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (5,2,null,2,to_date('03/10/12','DD/MM/RR'),null,1);
    Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (6,3,null,null,to_date('22/09/12','DD/MM/RR'),to_date('23/09/12','DD/MM/RR'),1);
    Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (7,3,null,4,to_date('23/09/12','DD/MM/RR'),null,1);
    Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (8,2,null,null,to_date('12/10/12','DD/MM/RR'),null,1);
    --------------------------------------------------------
     CREATE TABLE "SERVICE" 
       (     "SERVICE_ID" NUMBER, 
         "ENG_ID" NUMBER, 
         "DESCRIPTION" VARCHAR2(200 BYTE), 
         "DATE_STARTED" DATE, 
         "DATE_TERMINATED" DATE, 
         "ACTIVE" NUMBER DEFAULT 1
       );
    /
    
    Insert into SERVICE (SERVICE_ID,ENG_ID,DESCRIPTION,DATE_STARTED,DATE_TERMINATED,ACTIVE) values (1,1,'Counselling',to_date('15/09/12','DD/MM/RR'),to_date('18/09/12','DD/MM/RR'),1);
    Insert into SERVICE (SERVICE_ID,ENG_ID,DESCRIPTION,DATE_STARTED,DATE_TERMINATED,ACTIVE) values (2,1,'Housing',to_date('20/09/12','DD/MM/RR'),null,1);
    Insert into SERVICE (SERVICE_ID,ENG_ID,DESCRIPTION,DATE_STARTED,DATE_TERMINATED,ACTIVE) values (3,2,'Treatment',to_date('01/10/12','DD/MM/RR'),to_date('15/10/12','DD/MM/RR'),1);
    Insert into SERVICE (SERVICE_ID,ENG_ID,DESCRIPTION,DATE_STARTED,DATE_TERMINATED,ACTIVE) values (4,3,'Housing',null,null,1);
    Insert into SERVICE (SERVICE_ID,ENG_ID,DESCRIPTION,DATE_STARTED,DATE_TERMINATED,ACTIVE) values (5,1,'Other',to_date('05/10/12','DD/MM/RR'),null,0);
    Insert into SERVICE (SERVICE_ID,ENG_ID,DESCRIPTION,DATE_STARTED,DATE_TERMINATED,ACTIVE) values (6,2,'Treatment',to_date('16/10/12','DD/MM/RR'),null,1);
    ****
    And that's the perspective I think to use as a basis for the report
    CREATE OR REPLACE FORCE VIEW "BASE_VW" 
     
    AS
      SELECT Def.Def_Id,
        Def.First_Name,
        Def.Last_Name,
        Eng.Eng_Id,
        Eng.Court_Name,
        Eng.Date_Joined,
        Eng.Date_Terminated,
        Eng.Ethnicity,
        Ser.Service_Id,
        Ser.Description,
        Ser.Date_Started    AS Service_Start_Date,
        Ser.Date_Terminated AS Service_Date_Terminated,
        Ser.Active          AS Service_Active,
        Ev.Event_Id,
        Ev.Related_Service_Id,
        Ev.Start_Date,
        Ev.End_Date,
        Ev.Notes,
        ev.active AS event_active
      FROM Defendant Def
      LEFT OUTER JOIN Engagement Eng
      ON Def.Def_Id = Eng.Def_Id
      LEFT OUTER JOIN Service Ser
      ON Eng.Eng_Id = Ser.Eng_Id
      LEFT OUTER JOIN Event Ev
      ON Ev.Eng_Id = Eng.Eng_Id;
    ****
    Requirement:
    Report parameter: Start Date, end Date, Court_name
    Of selected Court_name, list of defendants who are currently participating in the Court.
    For each display of the defendant
    Section 1: Identification of the details: first name, surname, ethnicity, Date of arrival in the Court
    Section 2: All currently active Services that the defendant attend
    Section 3: All the events related to the service attending the defendant
    Section 4: All other events (don't have IDS Service related)

    The user must be able to download the full report in the spreadsheet or in PDF format.
    I tried to create a set of Union chooses (but the format is not that good, when no data return show nothing, I would like to show rather some messages as "There is no associated event, rather than nothing")
    and he produced a report for 1 defendant at the same time.

    We use Oracle APEX, so only select statement or statement select return PL/SQL Code is valid for the report source.
    At our place, we use Jasper adjacent report at the APEX, but I have very little experience with report of Jasper.
    The developer who knows a lot about the report of jasper is too busy to help me.

    Currently I use the union chooses as below:
    With Current_Engagement As
    ( Select Eng_Id From Engagement
      Where Def_Id =2
      And Date_Joined Is Not Null
      And ( Date_Terminated Is Null Or Date_Terminated > Sysdate)
      And Rownum =1
    )
    Select '1.Defendant ID' as col1, 'First Name' as col2, 'Last Name' as col3, 'Court Name' as col4, 'Ethnicity' as col5, 'Date Joined' as col6, 'Date Terminated' as col7
    From Dual
    
    Union All
    
    Select Distinct to_char(Def_Id), First_Name, Last_Name, Court_Name, Ethnicity, to_char(Date_Joined), to_char(Date_Terminated)
    From Base_Vw Inner Join Current_Engagement Ce On Base_Vw.Eng_Id = Ce.Eng_Id
    
    Union All 
    select '2.Service ID', 'Service Description', 'Start Date', 'End Date', Null, Null, Null
    from dual
    
    Union All
    
    Select distinct to_char(service_id), description, to_char(service_start_date), to_char(service_date_terminated), null, null, null
    From Base_Vw Inner Join Current_Engagement Ce On Base_Vw.Eng_Id = Ce.Eng_Id
    where service_active =1
    
    Union All
    Select '3.Event ID', 'Related Service ID', 'Start Date', 'End date', 'Notes', null, null
    From Dual
    
    Union All
    Select distinct to_char(event_id), to_char(related_service_id), to_char(start_date), to_char(end_date), notes, null, null
    from Base_Vw Inner Join Current_Engagement Ce On Base_Vw.Eng_Id = Ce.Eng_Id
    Where Event_Active = 1
    and related_service_id is not null
    
    Union All
    
    Select '4.Event ID', 'Start Date', 'End date', 'Notes', null, null, null
    From Dual
    
    Union All
    
    Select distinct to_char(event_id), to_char(start_date), to_char(end_date), notes, null, null, null
    From Base_Vw Inner Join Current_Engagement Ce On Base_Vw.Eng_Id = Ce.Eng_Id
    Where Event_Active = 1
    and related_service_id is null
    and the result is a bit what I try to achieve (except that I need to work on the screen a message "No data found" rather than anything), but it seems that my code works for one respondent.
    COL1                           COL2                           COL3                           COL4                 COL5                 COL6        COL7          
    ------------------------------ ------------------------------ ------------------------------ -------------------- -------------------- ----------- ---------------
    1.Defendant ID                 First Name                     Last Name                      Court Name           Ethnicity            Date Joined Date Terminated 
    2                              John                           Doe                            BBB                  Asian                01/10/12                    
    2.Service ID                   Service Description            Start Date                     End Date                                                              
    3                              Treatment                      01/10/12                       15/10/12                                                              
    6                              Treatment                      16/10/12                                                                                             
    3.Event ID                     Related Service ID             Start Date                     End date             Notes                                            
    5                              2                              03/10/12                                                                                             
    4.Event ID                     Start Date                     End date                       Notes                                                                 
    4                              02/10/12                                                                                                                            
    8                              12/10/12                                                                                                                            
    
     10 rows selected 
         
    However, I struggle to find a way to apply this to more than 1 defendant and always keep the format.
    Defendant 1
    All details related to defendant 1 
    Defendant 2
    All details relayed to defendant 2
    ...
    Defendant n
    All details relayed to defendant n
    Is it possible to view a report as above using only the SQL script?


    Thank you very much in advance. I'm ready to financially compensate someone who can give me a solution.

    Edited by: Ann586341. Base_vw SQL view script is fixed.

    Hi, Ann.

    The query I posted earlier can be simplified a bit. You need not partitioned outer joins, which means that you don't need d_num.

    WITH     current_engagement     AS
    (
         SELECT  Def.Def_Id
         ,     Def.First_Name
         ,         Def.Last_Name
         ,         Eng.Eng_Id
         ,         Eng.Court_Name
         ,         Eng.Date_Joined
         ,         Eng.Date_Terminated
         ,         Eng.Ethnicity
         ,     ROW_NUMBER () OVER ( PARTITION BY  def.def_id
                                   ORDER BY          eng.date_joined
                             ,                eng.eng_id
                           )      AS e_num
         FROM      Defendant   Def
           JOIN       Engagement  Eng  ON   Def.Def_Id = Eng.Def_Id
         WHERE     (   Eng.Date_Terminated  IS NULL
              OR  Eng.Date_Terminated      >= TO_DATE (:p_start_date, 'DD/MM/YYYY')
              )
         AND     Eng.Date_Joined           <= TO_DATE (:p_end_date,   'DD/MM/YYYY')
         AND     Eng.court_name           = :p_court_name
    )
    ,     event_types          AS
    (
         SELECT  3.2 AS event_type     FROM dual     UNION ALL
         SELECT     4.2                   FROM dual
    )
    ,     union_results          AS
    (               -- Section 1 Header: 1 row per defendant
         SELECT  '1.Defendant ID'     AS col1
         ,     'First Name'           AS col2
         ,     'Last Name'          AS col3
         ,     'Court Name'           AS col4
    --     ,      'Ethnicity'           AS col5 ...
         ,     def_id
         ,     1.1               AS section_num
         ,     0               AS r_num
         FROM     current_engagement
         WHERE     e_num     = 1
        UNION ALL          -- Section 1 Data: 1 row per defendant
             SELECT     TO_CHAR (def_id)        AS col1
         ,     first_name             AS col2
         ,     last_name             AS col3
         ,     court_name             AS col4
         ,     def_id
         ,     1.2               AS section_num
         ,     1               AS r_num
         FROM     current_engagement
         WHERE     e_num     = 1
        UNION ALL          -- Section 2 Header: 1 row per defendant
           SELECT  '2.Service ID'             AS col1
           ,       'Service Description'     AS col2
           ,       'Start Date'          AS col3
           ,       'End Date'          AS col4
           ,       def_id
           ,       2.1               AS section_num
           ,       0               AS r_num
           FROM    current_engagement
        UNION ALL          -- Section 2 Data: 1 row per service (at least 1 per defendant)
           SELECT DISTINCT
                       NVL ( TO_CHAR (s.service_id),  'No Data')      AS col1
           ,       NVL (s.description,            'No Data')      AS col2
           ,       NVL ( TO_CHAR (s.date_started, 'DD/MM/YYYY')
                               ,                           'No Data')        AS col3
           ,       NVL ( TO_CHAR (s.date_terminated, 'DD/MM/YYYY')
                               ,                           'No Data')      AS col4
           ,       ce2.def_id
           ,       2.2                               AS section_num
           ,       s.service_id                AS r_num
           FROM              current_engagement  ce2
           LEFT OUTER JOIN     service              s      ON   s.eng_id  = ce2.eng_id
                                       AND      s.active  = 1
        UNION ALL          -- Section 3 Header: 1 row per defendant
           SELECT  '3.Event ID'               AS col1
           ,       'Related Service ID'     AS col2
           ,       'Start Date'          AS col3
           ,       'End date'          AS col4
           ,       def_id
           ,       3.1               AS section_num
           ,       0               AS r_num
           FROM    current_engagement
        UNION ALL          -- Section 4 Header: 1 row per defendant
           SELECT  '4.Event ID'               AS col1
           ,       'Start Date'          AS col2
           ,       'End date'          AS col3
           ,       'Notes'               AS col4
           ,       def_id
           ,       4.1               AS section_num
           ,       0               AS r_num
           FROM    current_engagement
        UNION ALL          -- Section 3+4 Data: 1 row per event (at least 2 per defendant)
           SELECT DISTINCT
                       NVL ( TO_CHAR (e.event_id),    'No Data')      AS col1
           ,       NVL ( CASE  et.event_type
                                     WHEN  3.2
                    THEN  TO_CHAR (e.related_service_id)
                    ELSE  TO_CHAR (e.start_date, 'DD/MM/YYYY')
                   END
                               ,                     'No Data')      AS col2
           ,       NVL ( CASE  et.event_type
                                     WHEN  3.2
                    THEN  TO_CHAR (e.start_date, 'DD/MM/YYYY')
                    ELSE  TO_CHAR (e.end_date,   'DD/MM/YYYY')
                   END
                               ,                           'No Data')        AS col3
           ,       NVL ( CASE  et.event_type
                                     WHEN  3.2
                    THEN  TO_CHAR (e.end_date  , 'DD/MM/YYYY')
                    ELSE  e.notes
                   END
                               ,                           'No Data')      AS col4
           ,       ce34.def_id
           ,       et.event_type                          AS section_num
           ,       e.event_id                           AS r_num
           FROM              current_engagement  ce34
           CROSS JOIN     event_types         et
           LEFT OUTER JOIN     event              e      ON   e.eng_id  = ce34.eng_id
                                       AND  e.active  = 1
                                       AND  NVL2 ( e.related_service_id
                                                    , 3.2
                                                , 4.2
                                                )    = et.event_type
    )
    SELECT       col1, col2, col3, col4
    FROM       union_results
    ORDER BY  def_id
    ,            section_num
    ,       r_num
    ;
    
  • do you need a power supply to the current entry with data acquisition or 9265

    Hello I just receive the NI 9265 Daq for research in my lab. I'm trying to present entry and display it on an oscilloscope. I don't get anything. I did some research on the internet, so my question is do you need a power supply to the current entry with data acquisition or 9265?

    Read the data sheet.  Clearly on the first page is a sentence which reads "the NI 9265 requires 9 V to 36 V external power.

  • VMware power cli version

    Hi experts,

    I'm new to vmware power cli, so please excuse stupid request. -

    I have vcenter 6.0 and I want to know what power cli version should I download to connect to vcenter, is limited with the VC version or I can download any version of vmware cli power.

    I need windows electric cli to run vmware cli power.

    Thank you very much in advance.

    Concerning

    KP

    You can find this info in the VMware product interoperability Matrices

    You must PowerCLI 6.x

  • HP g60-440us think needs new power supply

    I am a computer SCIENCE student, have a laptop HP g60-440us, needs new power supply.

    Do you think that the replacement of the it's an ideal first project?  Please inform honestly.

    Thank you

    It is quite another thing. It is not an internal power supply but the power module.

    This is the part you need:

    part

    It is the repair:

    Manual

    You don't need to weld anything. You open the laptop, remove the old module and replace with a new one. Not too difficult though as it takes concentration and following the manual and keep track of which screws go where. It is a very good first laptop repair project.

  • Creation of computer virtual using Power CLI

    Hello

    I'm attaching to deploy virtual computer using power CLI but I get the error like below below:

    I use the script below to deploy the VM model exisitin

    New-vm-name testvm005 - VMhost home - model TMPL_W2K3_STD_SP2_R2_x86 - datstorename - OSCustomizationspec-W2K3-ENT-R2-SP2 data store - 32 bit

    New - VM: 25/05/2011 10:37:09 New-VM parameter specified ' Templa
    you ' expect a single value, but your name criteria "TMPL_W2K3_STD_SP2_R2_x86" c
    orresponds to multiple values.

    Can somone help out me on this...

    It seems that if you have more than 1 model with that name in your vCenter.

    Make one

    Get-model

    to check it out.

    If you want to use a specific template, you will need to find a distinctive feature.

    Suppose for example that the model that you want to use is located in a folder named MyTemplates, then you can do

    $template = get-Template-name TMPL_W2K3_STD_SP2_R2_x86-location (Get - file - name MyTemplates)

    New-vm-name testvm005 - VMhost home - model $template Datastore - datstorename - OSCustomizationspec W2K3-ENT-R2-SP2 - 32-bit

  • Failure of power CLI remove Datastore

    The Installation of ESXi generates a "datastore1".

    It is possible to generate an additional data store named 'Datastore1' via PowerCLI.

    The name is keysensitive, because it is not possible to generate an additional "datastore1".

    I have the following problem:

    With CLI power, it is not possible to remove the Datastore1 or datastore1.

    the command remove-data store with the parameter of the data store name cannot remove the data store,

    with error: there is more than one object with the name 'datastore1 '.

    In this command, the name is not supported keysensitive.

    It is not possible to use the ID of the store of data as a parameter for the deletion.

    Anyone have an idea how I could handle this problem with Power CLI?

    Thanks for the help!

    Chris

    What you can do to remove a specific data store, is to use the operator - ceq PowerShell which performs a case-sensitive comparison. Something like:

    Get-Datastore | Where-Object { $_.Name -ceq "Datastore1" } | Remove-Datastore
    

    If you want to remove both you can do:

    Get-Datastore | Where-Object { $_.Name -eq "Datastore1" } | Remove-Datastore
    

    Robert

Maybe you are looking for

  • A song stops and goes to the next song in iTunes.

    My favorite song of Foo Fighters stopped playing 4 seconds and then move to the next song.  It does on my iPhone and iTunes online.  However, it will play through on my Groove music completely in Windows 10.  Help!  I need this problem soon... I can'

  • Driver Bluetooth for HP probook 470 G1 (D9P03AV #UUF) running Windows 8.1 64bits

    Hey guys, I just tried my ps3 controllers to connect to my laptop and I realized its not detecting not not my bluetooth adapter. IM on a g1 470 probook with card wifi realtek 8188 EA, is the integrated bluetooth adapter? I tried all THE drivers on th

  • Satellite P10 804: can I install module BT PA3121U-3BTM?

    I can install a Bluetooth PA3121U-3BTM in my P10-804, if so someone can give me pointers or a diagram... Please... Please... THX

  • How to run several motors in parallel using NI 9501

    I want to run three engines at the same time using NI c series module and compac rio 9501 9074 with the example built in open loop speed control... I need to change in the code than anything... Actually, I copied the same fpga code and change the set

  • Printer and PC does not

    My Lexmark X 4690 has stopped communicating with my HP laptop. I can print if I use an Ethernet cable, and I printed a test page, so it is not the printer itself. On one of the screens I have seen, he said 'PC has stopped communicating with the print