How to format better my query for a report?

I have a shell script to run sql queries to get database information everyday.
However here below, I want some columns to be indented to the right, and I also want to format the column with %.
Also for the column name , underneath the column name, there are lines which very long and over one line, how to make it within a linesize?
Checking DataGuard Status/Information
message error time
FACILITY SEVERITY DEST_ID number code CAL stamp MESSAGE
======================== ============= ========== ========== ========== === ========= ================================================================================================================================================================================================================================================================
Thanks,

Refer the below link for all format models and elements..etc
http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm
Hope this helps,
Regards
http://www.oracleracexpert.com
Transportable tablespace export and import
http://www.oracleracexpert.com/2009/09/transportable-tablespace-export-and.html
Oracle data pump export/import with examples.
http://www.oracleracexpert.com/2009/08/oracle-data-pump-exportimport.html

Similar Messages

  • How to terminate the running query for a report?

    Hi,
    When I run a report, the SQL query takes too long.
    This causes an overload on database.
    How do I stop query from running after some time?

    It is NOT possible in OBIEE 10g.
    In OBIEE 11g, When a scheduled report job is in running status, you can now cancel the running job from the Report Job History page.
    Check this Section 6.9, ["Canceling a Running Job." |http://docs.oracle.com/cd/E23943_01/bi.1111/e22257/view_manage_rpt_his.htm#cancel_runj]
    And only possible since 11.1.1.5
    regards
    Jorge
    p.s If this answers your question then please mark my answer as "Correct" or "Helpful"

  • How to run a search query for a particular folder in KM related to portal

    Hi,
    Can any one tell me the steps for : how to run a search query for a particular folder in knowledge management related to portal.
    Answers will be rewarded.
    Thanks in advance.
    KN
    Edited by: KN on Mar 18, 2008 6:33 AM

    Ok u may not require a coding
    But u req configuration
    U should first make a search option set
    Link: [Search Option set|http://help.sap.com/saphelp_nw04/helpdata/en/cc/f4e77ddef1244380b06fee5f8b892a/frameset.htm]
    Then u need 2 duplicate a KM Command by the name Search From here
    and customize it to include the Search Option that u have created
    Link: [Search from here|http://help.sap.com/saphelp_nw04/helpdata/en/2a/4ff640365d8566e10000000a1550b0/frameset.htm]
    Then in the layout add this command.
    Regards
    BP

  • How to find top utilized query for last two months in oem

    how to find top utilized query for last two months in oracle enterprise manager?

    Can you mark the thread as Helpful  and once marked the information can be reviewed by other customer for similar queries
    Regards
    Krishnan

  • Better user experience for slow reports (loading in background, progressbar

    Hi
    In our application, some reports take a long time till they are displayed. Therefore it would be nice, if i could provide the user with some feedback (example: progressbar). Is it possible to have this? Upon print, when a pdf file is being constructed (in web) we already have such functionality in place, is it possible to have it generally?
    Mayb,e it would also be possible to have the report load the first page quickly, so the user has already something to look at, and load all the other needed data in a background thread. (i dont think it is possible, however, somebody may have an idea)
    Does anybody have an idea how we could achieve a better user experience for our reports. Any help is appreciated. Thanks.
    Greetings
    I am using:
    Crystal Reports 2008 (in Asp.net, Windows Forms)
    Version .NET 3.5 (SP1)
    PS: of course a very fast report would be the finest solution. However, i guess this will not be possible with our reports and the volume of data they access

    Hi Daniel,
    Crystal Report 2008 we have a inbuilt functionality of progress bar .If you are not getting progress bar for every report that means those reports are not taking to much time.
    For more info regarding progressbar  this check this link:
    [https://boc.sdn.sap.com/node/8035]
    Look for processingIndicatorDelay and processingIndicatorText.
    If you want to improve performance of report then we need to keep in mind few thing while creating report in Crystal report designer:
    Here are a few points related to performance issue .
    The performance of a report is related to:
    External factors:
    1. The amount of time the database server takes to process the SQL query.
    ( Crystal Reports send the SQL query to the database, the database process it, and returns the data set to Crystal Reports. )
    2. Network traffics.
    3. Local computer processor speed.
    ( When Crystal Reports receives the data set, it generates a temp file to further filter the data when necessary, as well as to group, sort, process formulas, ... )
    4. The number of records returned
    ( If a SQL query returns a large number of records, it will take longer to format and display than if was returning a smaller data set.)
    Report design:
    1. Where is the Record Selection evaluated?
    Ensure your Record Selection Formula can be translated in SQL, so the data can be filter down on the server, otherwise the filtering will be done in a temp file on the local machine which will be much slower.
    They have many functions that cannot be translated in SQL because they may not have a standard SQL for it.
    For example, control structure like IF THEN ELSE cannot be translated into SQL. It will always be evaluated
    in Crystal Reports. But if you use an IF THEN ELSE on a parameter, it will convert the result of the condition to
    SQL, but as soon as uses database fileds in the conditions it will not be translated in SQL.
    2. How many subreports the report contains and in section section they are located.
    Minimise the number of subreports used, or avoid using subreports if possible because
    subreports are reports within a report, and if you have a subreport in a details section, and the report returns 100
    records, the subreport will be evaluated 100 times, so it will query the database 100 times. It is often the biggest
    factor why a report takes a long time to preview.
    3. How many records will be returned to the report.
    Large number of records will slow down the preview of the reports. Ensure you only returns the necessary data on the report, by creating a Record Selection Formula, or basing your report off a Stored Procedure, or a Command Object that only returns the desired data set.
    4. Do you use the special field "Page N of M", or "TotalPageCount"
    When the special field "Page N of M" or "TotalPageCount" is used on a report, it will have to generate each page
    of the report before it displays the first page, therfore it will take more time to display the first page of the report.
    If you want to improve the speed of a report, remove the special field "Page N of M" or "Total Page Count" or formula that uses the function "TotalPageCount". If those aren't use when you view a report it only format the page requested. It won't format the whole report.
    5. Link tables on indexed fields whenever possible.
    6. Remove unused tables, unused formulas, unused running totals from the report.
    7. Suppress unnecessary sections.
    8. For summaries, use conditional formulas instead of running totals when possible.
    9. Whenever possible, limit records through selection, not suppression.
    10. Use SQL expressions to convert fields to be used in record selection instead of using formula functions.
    For example, if you need to concatenate 2 fields together, instead of doing it in a formula, you can create a SQL Expression Field. It will concatenate the fields on the database server, instead of doing in Crystal Reports.
    SQL Expression Fields are added to the SELECT clause of the SQL Query send to the database.
    11. Using one command as the datasource can be faster if you returns only the desired data set. It can be faster if the SQL query written only return the desired data.
    12. Perform grouping on server
    This is only relevant if you only need to return the summary to your report but not the details. It will be faster as less data will be returned to the reports.
    Hope this helps!!
    Regards,
    Shweta

  • Improving a query for a report in b1

    Dear All,
    We have a query  for a report. this report display all invoices with it´s Dscription in the system just have 3 descriptions so i need the the report display the this description in column not in row and then have the sum by  description. i dont know how can i put a picture for showing the example.
    Some one knows how can i do? down the code.
    Regards
    NANCY
    SELECT distinct  T1.visorder as 'No. Linea',
                            T0.DocNum as 'No. Factura',
                            T0.DocDate as 'Fecha',
                            T0.CardName as 'Cliente',
                            T1.U_CANTIDAD as 'Tonelaje',
                            T0.U_OPERACION as 'No. Operación',
                            T0.DocCur as 'Moneda',
                            T0.GrosProfit as 'Ingreso total de factura',
                            T1.ItemCode as 'Código',
                            T1.Dscription,
                            T1.Quantity*T1.Price as 'Importe por Servicio',
                            T1.LineVat as 'IVA por servicio',
                            T0.VatSum as 'IVA por factura',
                            T2.PlngGroup as 'Cuenta SUN'
    FROM OINV T0 LEFT JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
    inner join OCRD T2 ON T0.CardCode = T2.CardCode
    WHERE T0.Series = 49 and
                T0.DocDate BETWEEN [%0] AND [%1]

    Hi Nancy,
    I'm not sure that I understand your requirement 100% but assuming you only have 3 descriptions then the following would give you totals for your different descriptions...
    Simply replace the text ' etc in the code below with the descriptions values.
    SELECT distinct 
         T1.visorder as 'No. Linea',
            T0.DocNum as 'No. Factura',
            T0.DocDate as 'Fecha',
            T0.CardName as 'Cliente',
            T1.U_CANTIDAD as 'Tonelaje',
            T0.U_OPERACION as 'No. Operación',
            T0.DocCur as 'Moneda',
            T0.GrosProfit as 'Ingreso total de factura',
            T1.ItemCode as 'Código',
            CASE
                   WHEN T1.Dscription = '<description1>'
                   THEN T1.Quantity*T1.Price
                   ELSE 0
              END as '<description1>',
              CASE
                   WHEN T1.Dscription = '<description2>'
                   THEN T1.Quantity*T1.Price
                   ELSE 0
              END as '<description2>',
              CASE
                   WHEN T1.Dscription = '<description3>'
                   THEN T1.Quantity*T1.Price
                   ELSE 0
              END as '<description3>',
            T1.LineVat as 'IVA por servicio',
            T0.VatSum as 'IVA por factura',
            T2.PlngGroup as 'Cuenta SUN'
    FROM OINV T0 LEFT JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
    inner join OCRD T2 ON T0.CardCode = T2.CardCode
    WHERE T0.Series = 49 and
                T0.DocDate BETWEEN [%0] AND [%1]
    Hope this helps.
    Regards,
    Sean

  • Crosstab query for a report

    I've created the below crosstab query for a report.
    Select Grouping_Condition,Warehouse,Max(Value) Over (Partition By Grouping_Condition,Warehouse) As Total,
    Sum(Value) Over (Partition By Warehouse) As Total_Containers_Per_Warehouse,
    Sum(Vat1Ue) Over () As Total_Containers,
    (Max(Vat1Ue) Over (Partition By Grouping_Condition,Warehouse))
    /(Sum(Vat1Ue) Over (Partition By Warehouse))*100 As Total_Pct
    From
    Seleect Grouping_Condition,Warehouse,Count(*) As Value
    From
    Set1Ect
    T1.Warehouse,Shipped_Weight As Shipped_Tons,T1.Max_Weight As Maxtonnes,
    Case When (Shipped_Weight)< (T1.Max_Weight*0.001)*0.95 Then 'containers_under_95'
    When (Shipped_Weight*0.001) Between (T1.Max_Weight*0.001)*0.95 And (T1.Max_Weight*0.001) Then 'containers_95_100'
    Et1Se 'containers_above_weight'
    End Grouping_Condition
    From
    Tabt1E1 T1
    ,Tabt1E2 T2
    ,Tabt1E3 C
    Where
    T1.Co11 = T2.Col1
    And T1.Col2=C.Col2
    And More Conditions
    Where Warehouse In ('W1','W2','W3','W4','W5')
    Group By (Grouping_Condition,Warehouse)
    The Above Query Gives Me Output Something Like Below:
    Grouping_Condition Warehouse Total Total_Containers_Per_Warehouse Total_Containers Total_Pct
    Containers_95_100 W1 5 10 60 50
    Containers_Under_95 W1 5 10 60 50
    Containers_95_100 W2 10 20 60 50
    I've Got Report In The Below Format
    W1 W2 W3 W4 W5 Total
    Total_Containers 10 20 60
    Containers_95_100 5 10 15
    Containes_95_100_% 50 50 ????
    I Need To Calculate The Total Percentage In The Above Table With ????
    Any Help Is Much Appreciated..

    It appears as though you already have your groupings and counts per grouping, but require a ratio of each groupings count against all other counts. Is that correct ?
    If so, try the new 11g analytic function, something like this:
    select Grouping_Condition
          ,Warehouse
          ,ratio_to_report(Value) over () as Count_Ratio_over_Report
    ..

  • Need a query for monthly Report

    Hello All,
    I need a query for monthly report,
    comp_code
    emp_id
    dept_id
    work_day
    100
    A100
    MECH
    01/01/2013
    100
    A100
    MECH
    02/01/2013
    100
    A100
    MECH
    03/01/2013
    100
    A100
    MECH
    04/01/2013
    100
    A100
    MECH
    05/02/2013
    100
    A100
    MECH
    08/02/2013
    100
    A100
    MECH
    09/02/2013
    100
    A100
    MECH
    10/02/2013
    100
    A100
    MECH
    12/05/2013
    100
    A100
    MECH
    13/05/2013
    100
    A101
    CIV
    01/04/2013
    100
    A101
    CIV
    02/04/2013
    100
    A101
    CIV
    03/04/2013
    100
    A101
    CIV
    04/04/2013
    100
    A101
    CIV
    06/04/2013
    100
    A101
    CIV
    06/06/2013
    100
    A101
    CIV
    07/06/2013
    100
    A101
    CIV
    08/06/2013
    100
    A101
    CIV
    09/06/2013
    100
    A101
    CIV
    10/06/2013
    100
    A101
    CIV
    11/12/2013
    100
    A101
    CIV
    12/12/2013
    100
    A101
    CIV
    13/12/2013
    100
    A101
    CIV
    14/12/2013
        Dear friends this the sample table of my report.In which table has contain list of  employees with their working days(actual table has contain almost 5laks of records).
    suppose user choose the date between 01/01/2013 and 31/12/2013 then the result should be like this.
    comp_code
    emp_id
    dept_id
    month
    Total_work
    100
    A100
    MECH
    JANUARY
    4
    100
    A100
    MECH
    FEBRUARY
    2
    100
    A100
    MECH
    MARCH
    0
    100
    A100
    MECH
    APRIL
    0
    100
    A100
    MECH
    MAY
    2
    100
    A100
    MECH
    JUNE
    0
    100
    A100
    MECH
    JULY
    0
    100
    A100
    MECH
    AUGUST
    0
    100
    A100
    MECH
    SEPTEMBER
    0
    100
    A100
    MECH
    OCTOBER
    0
    100
    A100
    MECH
    NOVEMBER
    0
    100
    A100
    MECH
    DECEMBER
    0
    100
    A101
    CIV
    JANUARY
    0
    100
    A101
    CIV
    FEBRUARY
    0
    100
    A101
    CIV
    MARCH
    0
    100
    A101
    CIV
    APRIL
    5
    100
    A101
    CIV
    MAY
    0
    100
    A101
    CIV
    JUNE
    5
    100
    A101
    CIV
    JULY
    0
    100
    A101
    CIV
    AUGUST
    0
    100
    A101
    CIV
    SEPTEMBER
    0
    100
    A101
    CIV
    OCTOBER
    0
    100
    A101
    CIV
    NOVEMBER
    0
    100
    A101
    CIV
    DECEMBER
    4

    Hi,
    If you want the output to include months where no work was done (with 0 in the total_work column) then you need to outer-join a "table" that has one row per month, and make it a partitioned outer join:
    WITH  got_end_points   AS
       SELECT  TRUNC (MIN (work_day), 'MONTH')   AS first_month
       ,       TRUNC (MAX (work_day), 'MONTH')   AS last_month
       FROM    table_x
    ,   all_months   AS
       SELECT  ADD_MONTHS (first_month, LEVEL - 1)   AS a_month
       ,       ADD_MONTHS (first_month, LEVEL)       AS next_month
       FROM    got_end_points
       CONNECT BY  LEVEL <= 1 + MONTHS_BETWEEN (last_month, first_month)
    SELECT    t.comp_code
    ,         t.emp_id
    ,         t.dept_id
    ,         m.a_month
    ,         COUNT (t.work_day) AS total_work
    FROM             all_months  m
    LEFT OUTER JOIN  table_x     t  PARTITION BY (t.comp_code, t.emp_id, t.ept_id)
                                    ON   t.work_day  >= a.a_month
                                    AND  t.work_day  <  a.next_month
    GROUP BY  t.comp_code
    ,         t.emp_id
    ,         t.dept_id
    ,         m.a_month
    ORDER BY  t.comp_code
    ,         t.emp_id
    ,         t.dept_id
    ,         m.a_month
    As posted, this include every month that is actually in the table.  You can change the first sub-query if you want to enter first and last months.
    I hope this answers your question.
    If not, post  a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Point out where the query above is giving the wrong results, and explain, using specific examples, how you get the correct results from the given data in those places.  If you changed the query at all, post your code.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Sample query for Aging Report

    Hi! Anybody who has a sample sql query for aging report? basically this is the table structure and sample data
    bill_no B1-01 B1-02 B1-03
    bill_date 01-JAN 01-FEB 01-MAR
    previous_balance 100 600 800
    current_charges 500 200 400
    total_due 600 800 1200
    As of march 1, total due is 1200. how can i get the breakdown of 1200 as to the number of days it has been due. ex. 500 (60 days old 01-JAN to 01-MAR), 200 (30 days old), 400 (current)
    please help. thanks!
    null

    SELECT CEIL((SELECT MAX(Bill_Date) FROM Bill)- Bill_Date) Days , Previous_Balance, Current_Charges FROM Bill ORDER BY Days ASC
    Then create a matrix reprot.

  • How to get the spool id or how to create a spool id for the report .

    hi,
    how to get the spool id or how to create a spool id for the report .
    this spool id i have to use it in CONVERT_ABAPSPOOLJOB_2_PDF fm to get the pdf download file.
    my requirement is to download a pdf file from the alv grid list.

    Hi Raghu,
    Execute this program.
    REPORT  ZTEST_3318                              .
    tables: usr01.
    perform send_report_to_spool.
    *&      Form  send_report_to_spool
          text
    form send_report_to_spool.
      data: loc_dest like pri_params-pdest,
            wf_listname type char12,
            wf_listtext like PRI_PARAMS-PRTXT,
            wf_copies type i,
            wf_days type i,
            wf_PARAMS LIKE PRI_PARAMS,     " achieving file PRI_PARAMS.
            wf_valid type c.
      clear : wf_listname , loc_dest , wf_listtext .
      move: 'AP interface' to   wf_listname .
      move: 'AP interface' to   wf_listtext .
    select single spld into usr01-spld from usr01 where bname eq sy-uname .
      if sy-subrc eq 0 .
        move: usr01-spld to loc_dest .
      endif .
      call function 'GET_PRINT_PARAMETERS'
        EXPORTING
          destination    = loc_dest
          copies         = 1
          list_name      = wf_listname
          list_text      = wf_listtext
          immediately    = ' '
          release        = ' '
          new_list_id    = 'X'
          expiration     = 1
          line_size      = 200
          line_count     = 65
          layout         = 'X_65_200'
          sap_cover_page = 'X'
          receiver       = 'SAP*'
          department     = ''
          no_dialog      = 'X'
        IMPORTING
          out_parameters = wf_params
          valid          = wf_valid.
      if wf_valid <> space.
        new-page print on parameters wf_params no dialog.
        perform write_summary .
        new-page print off.
      endif .
    endform.                    "send_report_to_spool
    *&      Form  write_summary
          text
    -->  p1        text
    <--  p2        text
    FORM write_summary .
    data: begin of itab occurs 0,
          matnr type matnr,
          end of itab.
    select matnr
           from mara
           into table itab
           up to 10 rows.
    loop at itab.
    write: / itab-matnr.
    endloop.
    ENDFORM.                    " write_summary
    This will create spool in SP01.What data you want to put in Spool write it in form write_summary.I have done coding for testing purpose
    After that use that spool for your purpose.
    If Useful award point

  • How to set defalt parameter(s) for Crystal Report in CRS

    Hi everybody,
        I am new to Crystal Report designing and Crystal Report Server. My problem is; I had created one Crystal Report with sub-reports and some parameters. I had given default value for those parameters. These parameters are there in main report and linked with sub-reports. After that I deployed it in the Crystal Report Server.
        Now i want to schedule the report. while scheduling the report, I want to run the report using default parameter(s). If I Clicked on Schedule button, it is giving "report failed" error. And in parameter list it is showing "No parameters". Why this is happening? Is this default behaviour of Crystal Report Server? Can anybody please suggest me how can I give default values for a report automatically?(using Crystal Report Server)
    Thanks in Advance.
    Jithesh

    Not sure if I understand the question correctly or not.  It sounds like you have a main report, with a sub-report and a value is being passed from the main to the sub-report.
    When you say you created some parameters, are those parameters in the sub-report or main report?
    If it were me I would create a parameter in the main report, and a parameter in the sub report.  Have the two reports link on the two parameters. 
    When you go to schedule the job, set the default value in the cmc under process/parameters. 
    Let me know if this answers your question.  I tend to not fully understand the problem often times.
    Good luck!
    Rody

  • How to format new hard drive for Apple TV when you can't use old HD

    I need to know how to format a new HD to install in my Apple TV where I can't use the old HD to clone or otherwise create the new structure on the new HD.
    I have an Apple TV that was syncing to a Mac Mini that had a defective HD and logic board. I was unable to backup the Apple TV to the Mac Mini for some time before I had the mini repaired by AppleCare.
    When the mini came back, it registered on the Apple TV as a new computer and I couldn't sync with it without losing hundreds of dollars of content.
    All was okay until the other night when Apple's defective update for the ATV erased ALL my content. I updated it to 3.1 this morning, which Apple indicated might fix the problem. It didn't. The old content is all gone.
    My ATV is out of warranty, so I removed the old HD and copied the files from the "Purchased" folder to my mini. That saved most 101 items that I purchased since 12/08 (but not all for some reason). I lost all content prior to 12/08 that I purchased, as well as some content since 12/08 that I purchased.
    I need to keep the old HD untouched until I can purchase data recovery software. I'd like to just put a spare IDE HD in that I have into the ATV and just start over with what is in my Mac mini iTunes.
    So, how does one do that? I'm not gifted with vast Unix knowledge or experience and I don't want to clone the old HD and risk losing more data if it writes to the HD for some reason.
    Thanks.

    Hi Atagahi,
    Firstly, have you emailed Apple iTunes support indicating your issue? There have been instances in which Apple will allow re-downloading of all content you've purchased on the iTunes store.
    Secondly, I highly recommend you get an external usb hard drive, attach it to your mini and use it as a Time Machine drive to keep your iTunes purchases safe. It's a fact of life that all hard disk drives will eventually fail. The Apple TV should never be used as any kind of permanent storage space; think of it as a 'temporary holding' zone. And as you've unfortunately already experienced, a glitch wiped out all content on the Apple TV.
    As regards your original question, it seems like there have been folks who've done just that...taken the internal drive in the Apple TV out and attached it to a mac and copied files from the Apple TV hard drive. I have not had to do such, so I cannot offer any help here except for Linda's suggestion on googling the net for solutions.
    Good luck and hope you get all your purchased content back Atagahi!
    Message was edited by: Alec

  • Better SQL Query for clients without boundaries?

    I've been using and modifying/experimenting with Chris Nackers' SQL query for missing boundaries (http://myitforum.com/myitforumwp/2011/12/07/sql-query-to-identify-missing-smsconfigmgr-boundaries/)
    below (changed to add aliases)--but this seems to mainly be showing us non-clients, as several computers that were indeed missing boundaries (using SCCM 2007 SP2 R3, and all our boundaries are protected, most are IP Range, a few IP Subnet, none AD Site) are
    not being listed, and everything in the listing has NULL SYS.Client0.
    Is there a better query to pinpoint this issue, or maybe using something (error code or log?) that would show computers that can't find a distribution point or some other evidence of not having a boundary?
    Thanks!
    SELECT DISTINCT SYS.Name0, SYS.Client0, IPA.IP_Addresses0, IPS.IP_Subnets0, SMSAS.SMS_Assigned_Sites0
    FROM dbo.v_R_System SYS
    LEFT OUTER JOIN dbo.v_RA_System_IPSubnets IPS ON SYS.ResourceID = IPS.ResourceID
    LEFT OUTER JOIN dbo.v_RA_System_IPAddresses IPA ON SYS.ResourceID = IPA.ResourceID
    LEFT OUTER JOIN dbo.v_RA_System_SMSAssignedSites SMSAS ON SYS.ResourceID = SMSAS.ResourceID
    LEFT OUTER JOIN dbo.v_RA_System_SystemOUName SOU ON SYS.ResourceID = SOU.ResourceID
    WHERE (SMSAS.SMS_Assigned_Sites0 IS NULL)
    AND (NOT (IPA.IP_Addresses0 IS NULL))
    AND (NOT (IPS.IP_Subnets0 IS NULL))
    AND SYS.Operating_System_Name_and0 LIKE 'microsoft%server%'
    ORDER BY IPS.IP_Subnets0, SYS.Name0

    I gotcha now... I think most people, myself included, rely on finding clients that are not assigned to determine if a boundary is missing. If you expect clients to not be assigned that's not going to work for you.
    WHERE (SMSAS.SMS_Assigned_Sites0
    IS NULL) 
    AND (NOT (IPA.IP_Addresses0
    IS NULL))
    AND (NOT
    (IPS.IP_Subnets0 IS
    NULL))
    = This is saying show me all clients not assigned but they do have an IP address and they do have a subnet discovered.
    In the case of CM12 it is actually possible for that not to work anyway because you can have separate boundaries for client assignment and content lookup.
    I am not aware of any query that can compare the IP address, AD Site and IP subnet from each client to what's configured in boundaries and find machines that do not fall into any boundary.
    John Marcum | http://myitforum.com/myitforumwp/author/johnmarcum/

  • How should i write a query for this?

    Hi i give the follwing query to implement the result,
    IT will gives you the result of one country machines information like Total machines failed machines and success machines of their count
    Countyr Name  CountryCode  Total Machines Failed Machines and Succes machines and their perentage
      IT  ITALY
    1000 20
    980    98% 
    like these i want to display the 16 countyr machines information all country information in one palce  like table format
    i will give you the query to the below here it is the combination of powershell code also used here with sql code.
    Code as Country 
    Name as Country
    And below i mentioned OU in bold every where i will put the country code according to the country
    like OU=FR
    Select
            'FR' as 'Code',
            'FRANCE' as 'Name',
            (select COUNT(*) from ADComputersInfo where
        ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
        (select COUNT(*) from ADComputersInfo where
        ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations_Indus,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
        (select COUNT(*) from ADComputersInfo where
        ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Servers,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
        (select COUNT(*) from ADComputersInfo where
        ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
        or
        ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations_Indus,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
        or
        ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Servers,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
        (select count(distinct(cn)) from ADComputersInfo where
        (ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
        or
        ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations_Indus,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
        or
        ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Servers,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com')
        and cn in (select name0 from v_R_System)
        (select count(distinct(cn)) from ADComputersInfo where
        (ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
        or
        ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations_Indus,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
        or
        ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Servers,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com')
        and cn not in (select name0 from v_R_System)
        select count(distinct(cn)) from ADComputersInfo where
        (ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
        or
        ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations_Indus,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
        or
        ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Servers,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com')
        and cn in (select name0 from v_R_System where Client0 =1 and Obsolete0 =0)
        select count(distinct(cn)) from ADComputersInfo where
        (ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
        or
        ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations_Indus,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
        or
        ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Servers,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com')
        and cn not in (select name0 from v_R_System where Client0 =1 and Obsolete0 =0)
    So here i pass the County code and country name and OU=FR(assigned country code ) 
    so hw we can all these 3 values in all the query can give me the r8 query for this . And i will get the all 16 country information 
    Ineed exact query hw we can implement..........................................
    I might be excepting lot from our side guys...
    Thanks ! 
    Advanced

    Hi 
    Can you simple post sample data + desired result? Always state what version you are using..
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to set the default query for query component.

    I have a query component on the page, and there are 2 system query in the saved search dropdown list.
    Here is my system saved search
    Saved Search:
    Search by worker
    Search by organization.
    when the page load the default search panel is always search by worker.
    I want to default the search panel search by organization. How do I implement this.

    Thanks for your reply. Maybe I not describe my question clearly, I want to display different search form.
    For example
    when search by work, the search form displayed as firstname, lastname, gender etc.
    when search by work, the search form dispaly as organization name , manager name etc.
    I resolve this issue by customize the queryMode object.

Maybe you are looking for