Query to find all Partynames that come under the Global party Name

Hi All
I need a query to which can help me in listing all the Partynames that come under the top most rolled up customer
I need output like this:
PartyName,Party_number,Global_PartyName,GlobalRegistryId
Please help me.
Thanks
Bhavana

Could you please help me.. I am new to EBS..
Thanks
Bhavana
Edited by: user13689917 on Jan 17, 2011 3:49 PM

Similar Messages

  • Finding all employees who come under the manager

    Hi experts,
    I have created a report which is attahced in MSS. So i want to restrict the manager to view the details of  only the employees who come under this manager.  At present the report is showing the details of all employees. So pls tell me whehter i can use O-S-P relation for finding all direct and indirect employees of the mnagaer by passing the org unit of the manager (or) should i need to find all position holders who report to the manager's position?..  If so, how?
    Finding the list of all employees who come under manager org unit is same as finding the list of position holders who report to the manager position? Pls telll me which is correct and how to find the same?

    hello shanthi,
    mashhour is right, it largely depends on how data is being maintained in your system.
    first, you are generally mixing two concepts together of finding "direct" & "indirect" employees for a manager. In standard implementations, typically the data is maintain in such a way where only 1 method is appropriate to find a manager's employee, and the most common scenario is where the employee has an indirect relationship with their manager. 
    So typically the two are not used together.  In certain circumstances companies will implement both to create matrix like scenarios, but they are better ways to handle this. 
    The indirect method: is called this way, because the manager has a relationship to an org unit as the chief (a012), and his/her employees are in positions, which have relationships to those same org units, hence no direct relationship.
    In the direct method, a relationship is created directly between the manager's position and any subordinates positions using the A/B 002 relationship. 
    Assuming that you are using indirect only, then O-S-P with no depth defined, will all employees belonging to that entire org structure.  this is assuming your program knows the root ID of the manager relationship, which is the a012 to the root org unit. 
    best regards,
    michael

  • BO SDK Query to find all folders that a user has access to

    Hi Experts
    Please help me on BO SDK Query to "find all folders that a user has access in a single query".
    I am tried trial & error using PARENTS & CHILDREN. nothing worked
    Please advice
    Thanks!
    Prasath

    Hi Aasavari
    I am checking BO Web services samples and .NET samples. Please advice me the correct files to check the user/folder rights.
    Thank you so much
    Prasath
    http://wiki.sdn.sap.com/wiki/display/BOBJ/NETWebServicesSDKSamples

  • Query to find all journals which make up the balance on a GL Account?

    How can i query to find out all the journals which make up a balance on a particular code combinations balance?
    We are on R12 - 12.1.3

    Hi,
    You can try this:
    select l.effective_date, l.description, nvl(l.accounted_dr,0) - nvl(l.accounted_cr,0)
    from gl_je_lines l, gl_code_combinations cc, gl_je_headers h
    where l.code_combination_id = cc.code_combination_id
    and l.je_header_id = h.je_header_id
    and l.ledger_id = <ledger id>
    and h.currency_code = '<currency code>'
    and cc.code_combination_id = <code combination id>
    Octavio

  • SQL query to find all suites that are associated with automation

    I trying to incorporate CodeUI tests into a Release Mangement deployment template ... As a developer, I want to be able to specify a sub-tree of a test plan & only execute those test suites that are associated with automation.  Is there a way to
    extract all automated workitems and associated them with their respective test suites?
    Any assistance would be greatly appreciated!

    John,
    I've partially resolved the issue of executing a sub-set of suites with the following powershell implementation:
    1. Extract "potential" suite paths from a XML configuration file:
    <?xml version="1.0"?>
    <Configurations>
    <Properties>
    <Property key="DEFAULT" value="SuitePaths" />
    <Property key="DatabaseServer" value="MYDBSERVER" />
    <Property key="DatabaseInstance" value="Default" />
    <Property key="DatabaseName" value="TFS_DefaultCollection" />
    <Property key="ConfigurationName" value="US - Windows 7 and IE 10" />
    </Properties>
    <Notifications>
    <Notification key="0" value="[email protected]" />
    </Notifications>
    <SuitePaths>
    <SuitePath key="0" value="MyProject\WebProduct\Student\Features\Login" />
    <SuitePath key="1" value="MyProject\WebProduct\Student\Features\Logout" />
    </SuitePaths>
    <AreaPaths>
    <AreaPath key="0" value="MyProject\WebProduct\Student\Features\Login" />
    </AreaPaths>
    </Configurations>
    2. Extract record set of suites from TFS via SQL query:
    # FUNCTION: Retrieve-SuitePaths
    # Parameters:
    # (1.) LogFile -- Name of log file (e.g., C:\Temp or C:\Temp\DEPLOY_DatabaseServer_WebCMS2_DF06_20131031.6.log)
    # (2.) Connection -- Database connection
    # (3.) Paths -- Hash table of suite paths
    Function Retrieve-SuitePaths
    param
    [Parameter(Mandatory=$True)][String]$LogFile,
    [Parameter(Mandatory=$True)]$Connection,
    [Parameter(Mandatory=$True)]$Paths
    Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
    Write-Output "Retrieve suite(s): " | Out-File -FilePath $LogFile -Append
    Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
    $SuitePaths = "("
    $Counter = 0
    foreach ($Key in $Paths.Keys)
    if ($Counter -gt 0)
    $SuitePaths = $SuitePaths + ", "
    $SuitePaths = $SuitePaths + "'" + $Paths.Get_Item($Key) + "'"
    $Counter += 1
    $SuitePaths = $SuitePaths + ")"
    # --DEBUG ONLY--> Write-Output "Paths: $SuitePaths" | Out-File -FilePath $LogFile -Append
    $Command = New-Object System.Data.SqlClient.SqlCommand
    $SQLStatement = "
    WITH
    cte_SuiteChildren
    AS
    -- Anchor definition to pull all certify modes
    SELECT
    S.[SuiteId],
    S.[ProjectId],
    PJ.ProjectName,
    S.[PlanId],
    P.[Name] AS PlanName,
    S.[ParentSuiteId],
    S.[SuitePath],
    CONVERT(NVARCHAR(256), NULL) AS ParentTitle,
    S.[Title],
    0 AS RecurseLevel
    FROM
    [dbo].[tbl_Suite] AS S
    INNER JOIN [dbo].[tbl_Plan] AS P ON S.PlanID = P.PlanID
    INNER JOIN [dbo].[tbl_Project] AS PJ ON S.ProjectID = PJ.ProjectID
    WHERE
    S.ParentSuiteID = 0
    UNION ALL
    -- Recursive member to pull details of certify sessions
    SELECT
    S.[SuiteId],
    S.[ProjectId],
    PJ.ProjectName,
    S.[PlanId],
    P.[Name] AS PlanName,
    S.[ParentSuiteId],
    S.[SuitePath],
    PS.[Title] AS ParentTitle,
    S.[Title],
    SC.[RecurseLevel] + 1 AS RecurseLevel
    FROM
    [dbo].[tbl_Suite] AS S
    INNER JOIN cte_SuiteChildren AS SC on SC.SuiteID = S.ParentSuiteID
    INNER JOIN [dbo].[tbl_Suite] AS PS ON SC.SuiteId = PS.SuiteId
    INNER JOIN [dbo].[tbl_Plan] AS P ON S.PlanID = P.PlanID
    INNER JOIN [dbo].[tbl_Project] AS PJ ON S.ProjectID = PJ.ProjectID
    cte_SuiteLevel_0
    AS
    SELECT
    SC.[ProjectId],
    SC.[PlanId],
    SC.[SuiteId],
    SC.[ProjectName],
    SC.[PlanName],
    SC.[Title],
    SC.[ProjectName] + '\' + SC.[PlanName] AS Path,
    SC.[RecurseLevel]
    FROM
    cte_SuiteChildren AS SC
    WHERE
    SC.[RecurseLevel] = 0
    cte_SuiteLevel_1
    AS
    SELECT
    SC.[ProjectId],
    SC.[PlanId],
    SC.[ParentSuiteId],
    SC.[SuiteId],
    SC.[ProjectName],
    SC.[PlanName],
    SC.[Title],
    SC.[RecurseLevel]
    FROM
    cte_SuiteChildren AS SC
    WHERE
    SC.[RecurseLevel] = 1
    cte_SuiteLevel_2
    AS
    SELECT
    SC.[ProjectId],
    SC.[PlanId],
    SC.[ParentSuiteId],
    SC.[SuiteId],
    SC.[ProjectName],
    SC.[PlanName],
    SC.[Title],
    SC.[RecurseLevel]
    FROM
    cte_SuiteChildren AS SC
    WHERE
    SC.[RecurseLevel] = 2
    cte_SuiteLevel_3
    AS
    SELECT
    SC.[ProjectId],
    SC.[PlanId],
    SC.[ParentSuiteId],
    SC.[SuiteId],
    SC.[ProjectName],
    SC.[PlanName],
    SC.[Title],
    SC.[RecurseLevel]
    FROM
    cte_SuiteChildren AS SC
    WHERE
    SC.[RecurseLevel] = 3
    cte_SuiteLevel_4
    AS
    SELECT
    SC.[ProjectId],
    SC.[PlanId],
    SC.[ParentSuiteId],
    SC.[SuiteId],
    SC.[ProjectName],
    SC.[PlanName],
    SC.[Title],
    SC.[RecurseLevel]
    FROM
    cte_SuiteChildren AS SC
    WHERE
    SC.[RecurseLevel] = 4
    cte_SuiteLevel_5
    AS
    SELECT
    SC.[ProjectId],
    SC.[PlanId],
    SC.[ParentSuiteId],
    SC.[SuiteId],
    SC.[ProjectName],
    SC.[PlanName],
    SC.[Title],
    SC.[RecurseLevel]
    FROM
    cte_SuiteChildren AS SC
    WHERE
    SC.[RecurseLevel] = 5
    cte_SuiteLevel_6
    AS
    SELECT
    SC.[ProjectId],
    SC.[PlanId],
    SC.[ParentSuiteId],
    SC.[SuiteId],
    SC.[ProjectName],
    SC.[PlanName],
    SC.[Title],
    SC.[RecurseLevel]
    FROM
    cte_SuiteChildren AS SC
    WHERE
    SC.[RecurseLevel] = 6
    cte_SuiteLevel_7
    AS
    SELECT
    SC.[ProjectId],
    SC.[PlanId],
    SC.[ParentSuiteId],
    SC.[SuiteId],
    SC.[ProjectName],
    SC.[PlanName],
    SC.[Title],
    SC.[RecurseLevel]
    FROM
    cte_SuiteChildren AS SC
    WHERE
    SC.[RecurseLevel] = 7
    cte_SuiteLevel_8
    AS
    SELECT
    SC.[ProjectId],
    SC.[PlanId],
    SC.[ParentSuiteId],
    SC.[SuiteId],
    SC.[ProjectName],
    SC.[PlanName],
    SC.[Title],
    SC.[RecurseLevel]
    FROM
    cte_SuiteChildren AS SC
    WHERE
    SC.[RecurseLevel] = 8
    cte_SuiteLevel_9
    AS
    SELECT
    SC.[ProjectId],
    SC.[PlanId],
    SC.[ParentSuiteId],
    SC.[SuiteId],
    SC.[ProjectName],
    SC.[PlanName],
    SC.[Title],
    SC.[RecurseLevel]
    FROM
    cte_SuiteChildren AS SC
    WHERE
    SC.[RecurseLevel] = 9
    cte_SuiteLevel_10
    AS
    SELECT
    SC.[ProjectId],
    SC.[PlanId],
    SC.[ParentSuiteId],
    SC.[SuiteId],
    SC.[ProjectName],
    SC.[PlanName],
    SC.[Title],
    SC.[RecurseLevel]
    FROM
    cte_SuiteChildren AS SC
    WHERE
    SC.[RecurseLevel] = 10
    cte_Suites
    AS
    SELECT
    SL0.[ProjectId],
    SL0.[PlanId],
    CASE
    WHEN SL2.ParentSuiteId IS NULL
    THEN SL1.ParentSuiteId
    ELSE CASE
    WHEN SL3.ParentSuiteId IS NULL
    THEN SL2.ParentSuiteId
    ELSE CASE
    WHEN SL4.ParentSuiteId IS NULL
    THEN SL3.ParentSuiteId
    ELSE CASE
    WHEN SL5.ParentSuiteId IS NULL
    THEN SL4.ParentSuiteId
    ELSE CASE
    WHEN SL6.ParentSuiteId IS NULL
    THEN SL5.ParentSuiteId
    ELSE CASE
    WHEN SL7.ParentSuiteId IS NULL
    THEN SL6.ParentSuiteId
    ELSE CASE
    WHEN SL8.ParentSuiteId IS NULL
    THEN SL7.ParentSuiteId
    ELSE CASE
    WHEN SL9.ParentSuiteId IS NULL
    THEN SL8.ParentSuiteId
    ELSE CASE
    WHEN SL10.ParentSuiteId IS NULL
    THEN SL9.ParentSuiteId
    ELSE SL10.ParentSuiteId
    END
    END
    END
    END
    END
    END
    END
    END
    END AS [ParentSuiteId],
    CASE
    WHEN SL2.SuiteId IS NULL
    THEN SL1.SuiteId
    ELSE CASE
    WHEN SL3.SuiteId IS NULL
    THEN SL2.SuiteId
    ELSE CASE
    WHEN SL4.SuiteId IS NULL
    THEN SL3.SuiteId
    ELSE CASE
    WHEN SL5.SuiteId IS NULL
    THEN SL4.SuiteId
    ELSE CASE
    WHEN SL6.SuiteId IS NULL
    THEN SL5.SuiteId
    ELSE CASE
    WHEN SL7.SuiteId IS NULL
    THEN SL6.SuiteId
    ELSE CASE
    WHEN SL8.SuiteId IS NULL
    THEN SL7.SuiteId
    ELSE CASE
    WHEN SL9.SuiteId IS NULL
    THEN SL8.SuiteId
    ELSE CASE
    WHEN SL10.SuiteId IS NULL
    THEN SL9.SuiteId
    ELSE SL10.SuiteId
    END
    END
    END
    END
    END
    END
    END
    END
    END AS [SuiteId],
    SL0.ProjectName,
    SL0.PlanName,
    --SL0.Path,
    --SL1.[Title],
    CASE
    WHEN SL2.Title IS NULL
    THEN SL0.Path + '\' + SL1.Title
    ELSE CASE
    WHEN SL3.Title IS NULL
    THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title
    ELSE CASE
    WHEN SL4.Title IS NULL
    THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title
    ELSE CASE
    WHEN SL5.Title IS NULL
    THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title + '\' + SL4.Title
    ELSE CASE
    WHEN SL6.Title IS NULL
    THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title + '\' + SL4.Title + '\' + SL5.Title
    ELSE CASE
    WHEN SL7.Title IS NULL
    THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title + '\' + SL4.Title + '\' + SL5.Title + '\' + SL6.Title
    ELSE CASE
    WHEN SL8.Title IS NULL
    THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title + '\' + SL4.Title + '\' + SL5.Title + '\' + SL6.Title + '\' + SL7.Title
    ELSE CASE
    WHEN SL9.Title IS NULL
    THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title + '\' + SL4.Title + '\' + SL5.Title + '\' + SL6.Title + '\' + SL7.Title + '\' + SL8.Title
    ELSE CASE
    WHEN SL10.Title IS NULL
    THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title + '\' + SL4.Title + '\' + SL5.Title + '\' + SL6.Title + '\' + SL7.Title + '\' + SL8.Title + '\' + SL9.Title
    ELSE SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title + '\' + SL4.Title + '\' + SL5.Title + '\' + SL6.Title + '\' + SL7.Title + '\' + SL8.Title + '\' + SL9.Title + '\' + SL10.Title
    END
    END
    END
    END
    END
    END
    END
    END
    END AS Path,
    CASE
    WHEN SL2.RecurseLevel IS NULL
    THEN SL1.RecurseLevel
    ELSE CASE
    WHEN SL3.RecurseLevel IS NULL
    THEN SL2.RecurseLevel
    ELSE CASE
    WHEN SL4.RecurseLevel IS NULL
    THEN SL3.RecurseLevel
    ELSE CASE
    WHEN SL5.RecurseLevel IS NULL
    THEN SL4.RecurseLevel
    ELSE CASE
    WHEN SL6.RecurseLevel IS NULL
    THEN SL5.RecurseLevel
    ELSE CASE
    WHEN SL7.RecurseLevel IS NULL
    THEN SL6.RecurseLevel
    ELSE CASE
    WHEN SL8.RecurseLevel IS NULL
    THEN SL7.RecurseLevel
    ELSE CASE
    WHEN SL9.RecurseLevel IS NULL
    THEN SL8.RecurseLevel
    ELSE CASE
    WHEN SL10.RecurseLevel IS NULL
    THEN SL9.RecurseLevel
    ELSE SL10.RecurseLevel
    END
    END
    END
    END
    END
    END
    END
    END
    END AS RecurseLevel
    FROM
    cte_SuiteLevel_0 AS SL0
    LEFT OUTER JOIN cte_SuiteLevel_1 AS SL1 ON SL1.ParentSuiteId = SL0.SuiteId
    LEFT OUTER JOIN cte_SuiteLevel_2 AS SL2 ON SL2.ParentSuiteId = SL1.SuiteId
    LEFT OUTER JOIN cte_SuiteLevel_3 AS SL3 ON SL3.ParentSuiteId = SL2.SuiteId
    LEFT OUTER JOIN cte_SuiteLevel_4 AS SL4 ON SL4.ParentSuiteId = SL3.SuiteId
    LEFT OUTER JOIN cte_SuiteLevel_5 AS SL5 ON SL5.ParentSuiteId = SL4.SuiteId
    LEFT OUTER JOIN cte_SuiteLevel_6 AS SL6 ON SL6.ParentSuiteId = SL5.SuiteId
    LEFT OUTER JOIN cte_SuiteLevel_7 AS SL7 ON SL7.ParentSuiteId = SL6.SuiteId
    LEFT OUTER JOIN cte_SuiteLevel_8 AS SL8 ON SL8.ParentSuiteId = SL7.SuiteId
    LEFT OUTER JOIN cte_SuiteLevel_9 AS SL9 ON SL9.ParentSuiteId = SL8.SuiteId
    LEFT OUTER JOIN cte_SuiteLevel_10 AS SL10 ON SL10.ParentSuiteId = SL9.SuiteId
    SELECT
    SS.[ProjectId],
    SS.[PlanId],
    SS.[ParentSuiteId],
    SS.[SuiteId],
    SS.[ProjectName],
    SS.[PlanName],
    SS.[Path],
    SS.[RecurseLevel]
    FROM
    SELECT DISTINCT
    S.[ProjectId],
    S.[PlanId],
    S.[ParentSuiteId],
    S.[SuiteId],
    S.[ProjectName],
    S.[PlanName],
    S.[Path],
    S.[RecurseLevel]
    FROM
    cte_Suites AS S
    WHERE
    S.[RecurseLevel] IS NOT NULL
    AND S.[Path] IN $($SuitePaths)
    ) AS SS
    ORDER BY
    SS.[Path]
    $Command.CommandText = $SQLStatement
    $Command.Connection = $Connection
    $Command.CommandTimeout = 240
    $DataAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
    $DataAdapter.SelectCommand = $Command
    $DataSet = New-Object System.Data.DataSet
    $DataAdapter.Fill($DataSet) | Out-Null
    Write-Output "$SQLStatement" | Out-File -FilePath $LogFile -Append
    # --DEBUG ONLY--> $DataSet.Tables[0]
    return $DataSet
    3. Execute every suite in the record set via TCM
    $DataSet = ( Retrieve-SuitePaths -LogFile:$LogFile -Connection:$Connection -Path:$Paths)
    # --DEBUG ONLY--> $DataSet.Tables[0].Rows.Count
    # --DEBUG ONLY--> $DataSet.Tables[0]
    # Determine whether or not any test suites were retrieved from TFS....
    if ( $DataSet.Tables[0].Rows.Count -gt 0 )
    $ListTestRunID = $null
    $SumFailed = 0
    $SumInconclusive = 0
    foreach ($Row in $DataSet.Tables[0].Rows)
    # Set project, plan & suite variables....
    [Int16]$ProjectID = $Row.Item('ProjectId')
    [Int16]$PlanID = $Row.Item('PlanId')
    [Int16]$ParentSuiteID = $Row.Item('ParentSuiteId')
    [Int16]$SuiteID = $Row.Item('SuiteId')
    $ProjectName = $Row.Item('ProjectName')
    $PlanName = $Row.Item('PlanName')
    $Path = $Row.Item('Path')
    $RecurseLevel = $Row.Item('RecurseLevel')
    # Set local build path variable....
    switch -wildcard ($Path)
    "*WebCMS*\Administration\*"
    $CUITBuildPath = $CUITPathUNC + '\WebCMS\Administration'
    "*WebCMS*\Instructor\*"
    $CUITBuildPath = $CUITPathUNC + '\WebCMS\Instructor'
    "*WebCMS*\Student\*"
    $CUITBuildPath = $CUITPathUNC + '\WebCMS\Student'
    "*WebProduct*\Instructor\*"
    $CUITBuildPath = $CUITPathUNC + '\WebProduct\Instructor'
    "*WebProduct*\Student\*"
    $CUITBuildPath = $CUITPathUNC + '\WebProduct\Student'
    default
    $CUITBuildPath = $CUITPathUNC
    Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
    Write-Output 'Test Suite:' | Out-File -FilePath $LogFile -Append
    Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
    Write-Output " ID:" | Out-File -FilePath $LogFile -Append
    Write-Output " Project: $ProjectID" | Out-File -FilePath $LogFile -Append
    Write-Output " Plan: $PlanID" | Out-File -FilePath $LogFile -Append
    Write-Output " Parent Suite: $ParentSuiteID" | Out-File -FilePath $LogFile -Append
    Write-Output " Suite: $SuiteID" | Out-File -FilePath $LogFile -Append
    Write-Output " Config: $ConfigurationID" | Out-File -FilePath $LogFile -Append
    Write-Output " Name:" | Out-File -FilePath $LogFile -Append
    Write-Output " Project: $ProjectName" | Out-File -FilePath $LogFile -Append
    Write-Output " Plan: $PlanName" | Out-File -FilePath $LogFile -Append
    Write-Output " Config: $ConfigurationName" | Out-File -FilePath $LogFile -Append
    Write-Output " Path:" | Out-File -FilePath $LogFile -Append
    Write-Output " Suite: $Path" | Out-File -FilePath $LogFile -Append
    Write-Output " Build: $CUITBuildPath" | Out-File -FilePath $LogFile -Append
    # --DEBUG ONLY--> Write-Output " Recursion: $RecurseLevel" | Out-File -FilePath $LogFile -Append
    Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
    # Set TCM arguements....
    $ArguementPlanID = "/planid:$PlanID"
    $ArguementTitle = "/title:$Title - $Path (SuiteID: $SuiteID)"
    $ArguementSuiteID = "/suiteid:$SuiteID"
    $ArguementConfigurationID = "/configid:$ConfigurationID"
    $ArguementTFSCollection = "/collection:$TFSCollection"
    $ArguementTeamProject = "/teamproject:$TFSTeamProject"
    if(![string]::IsNullOrEmpty($CUITBuildPath))
    $ArguementBuildDirectory = "/builddir:$CUITBuildPath"
    $ArguementBuild = ""
    $ArguementBuildDefinition = ""
    else
    $ArguementBuildDirectory = ""
    $ArguementBuild = "/build:$TFSBuild"
    $ArguementBuildDefinition = "/builddefinition:$BuildDefinition"
    $ArguementTestEnvironment = "/testenvironment:$WebServer"
    $ArguementSettingsName = ""
    if(![string]::IsNullOrEmpty($SettingsName))
    $ArguementSettingsName = "/settingsname:$SettingsName"
    # Create test run....
    Write-Host "$TCMEXE 'run' '/create' $ArguementTitle $ArguementPlanID $ArguementSuiteID $ArguementConfigurationID $ArguementTFSCollection $ArguementTeamProject $ArguementBuild $ArguementBuildDefinition $ArguementBuildDirectory $ArguementTestEnvironment $ArguementSettingsName"
    Write-Output " $TCMEXE 'run' '/create' $ArguementTitle $ArguementPlanID $ArguementSuiteID $ArguementConfigurationID $ArguementTFSCollection $ArguementTeamProject $ArguementBuild $ArguementBuildDefinition $ArguementBuildDirectory $ArguementTestEnvironment $ArguementSettingsName" | Out-File -FilePath $LogFile -Append
    try
    $TestRunID = & $TCMEXE 'run' '/create' $ArguementTitle $ArguementPlanID $ArguementSuiteID $ArguementConfigurationID $ArguementTeamProject $ArguementTFSCollection $ArguementBuild $ArguementBuildDefinition $ArguementBuildDirectory $ArguementTestEnvironment $ArguementSettingsName
    catch
    $ExitMessage = $_Exception.Message
    # --DEBUG ONLY--> Write-Output "TestRunID: $TestRunID" | Out-File -FilePath $LogFile -Append
    if ($TestRunID -match '.+\:\s(?<TestRunID>\d+)\.')
    # The test run ID is identified as a property in the match collection so we can access it directly by using the group name from the regular expression (i.e. TestRunID).
    $TestRunID = $matches.TestRunID
    $ArguementID = "/id:$TestRunID"
    $TestRunResultsFile = $TempDirectory + "\TestRunResults$TestRunID.trx"
    $ArguementQueryText = "/querytext:SELECT * FROM TestRun WHERE TestRunID=$TestRunID"
    $ArguementResultsFile = "/resultsfile:""$TestRunResultsFile"""
    Write-Host " Waiting for test run to complete ..."
    Write-Host $TCMEXE 'run' '/list' $ArguementTeamProject $ArguementTFSCollection $ArguementQueryText
    Write-Output " $TCMEXE 'run' '/list' $ArguementTeamProject $ArguementTFSCollection $ArguementQueryText" | Out-File -FilePath $LogFile -Append
    $WaitingForTestRunCompletion = $true
    $WaitCount= 0
    while ($WaitingForTestRunCompletion)
    $WaitCount = $WaitCount + 1
    Write-Output " Waiting ($WaitCount)...." | Out-File -FilePath $LogFile -Append
    Start-Sleep -s $TestRunWaitDelay
    $TestRunStatus = & $TCMEXE 'run' '/list' $ArguementTeamProject $ArguementTFSCollection $ArguementQueryText
    $TestRunStatus
    if ($TestRunStatus.Count -lt 3 -or ($TestRunStatus.Count -gt 2 -and $TestRunStatus.GetValue(2) -match '.+(?<DateCompleted>\d+[/]\d+[/]\d+)'))
    $WaitingForTestRunCompletion = $false
    Write-Host "Evaluating test run $TestRunID results..."
    # Take small pause(s) since the results might not be published yet....
    Start-Sleep -s $TestRunWaitDelay
    # Export results....
    Write-Host $TCMEXE 'run' '/export' $ArguementID $ArguementTeamProject $ArguementTFSCollection $ArguementResultsFile
    Write-Output " $TCMEXE 'run' '/export' $ArguementID $ArguementTeamProject $ArguementTFSCollection $ArguementResultsFile" | Out-File -FilePath $LogFile -Append
    $WaitingForTestRunExport = $true
    $WaitCount= 0
    while ($WaitingForTestRunExport -and $WaitCount -lt 5)
    $WaitCount = $WaitCount + 1
    Write-Output " Waiting ($WaitCount)...." | Out-File -FilePath $LogFile -Append
    $ExportResult = & $TCMEXE 'run' '/export' $ArguementID $ArguementResultsFile $ArguementTFSCollection $ArguementTeamProject
    if ([System.IO.File]::Exists($TestRunResultsFile))
    $WaitingForTestRunExport = $false
    if ([System.IO.File]::Exists($TestRunResultsFile))
    # Load the XML document contents.
    [xml]$TestResultsXML = Get-Content "$TestRunResultsFile"
    # Extract the results of the test run.
    $TotalTests = $TestResultsXML.TestRun.ResultSummary.Counters.total
    $PassedTests = $TestResultsXML.TestRun.ResultSummary.Counters.passed
    $FailedTests = $TestResultsXML.TestRun.ResultSummary.Counters.failed
    $InconclusiveTests = $TestResultsXML.TestRun.ResultSummary.Counters.inconclusive
    # Output the results of the test run.
    Write-Host "========== Test: $TotalTests tests ran, $PassedTests succeeded, $FailedTests failed, $InconclusiveTests inconclusive =========="
    Write-Output "--------------------------------------------------------------------------------" | Out-File -FilePath $LogFile -Append
    Write-Output "Summary:" | Out-File -FilePath $LogFile -Append
    Write-Output "--------------------------------------------------------------------------------" | Out-File -FilePath $LogFile -Append
    Write-Output " Total: $TotalTests" | Out-File -FilePath $LogFile -Append
    Write-Output " Passed: $PassedTests" | Out-File -FilePath $LogFile -Append
    Write-Output " Failed: $FailedTests" | Out-File -FilePath $LogFile -Append
    Write-Output " Inconclusive: $InconclusiveTests" | Out-File -FilePath $LogFile -Append
    $SumFailed += $FailedTests
    $SumInconclusive += $InconclusiveTests
    # Remove the test run results file.
    [System.IO.File]::Delete($TestRunResultsFile) | Out-Null
    # Add "current" TestRunID to the list of TestRunID(s)....
    if ($ListTestRunID -ne $null)
    $ListTestRunID = $ListTestRunID + ', '
    $ListTestRunID = $ListTestRunID + $TestRunID
    # Next test suite....
    4. Extract record set of test runs  from TFS via SQL query:
    # FUNCTION: Retrieve-TestRuns
    # Parameters:
    # (1.) LogFile -- Name of log file (e.g., C:\Temp or C:\Temp\DEPLOY_DatabaseServer_WebCMS2_DF06_20131031.6.log)
    # (2.) Connection -- Database connection
    # (3.) ListTestRunID -- List of test run identifiers
    Function Retrieve-TestRuns
    param
    [Parameter(Mandatory=$True)][String]$LogFile,
    [Parameter(Mandatory=$True)]$Connection,
    [Parameter(Mandatory=$True)][String]$ListTestRunID
    Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
    Write-Output "Retrieve test run(s): " | Out-File -FilePath $LogFile -Append
    Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
    $TestRuns = '(' + $ListTestRunID + ')'
    $Command = New-Object System.Data.SqlClient.SqlCommand
    $SQLStatement = "
    WITH
    cte_State
    AS
    SELECT 0 AS [StateID], 'Unspecified' AS [StateName]
    UNION ALL
    SELECT 1 AS [OutcomeId], 'To Be Determined (1)' AS [StateName]
    UNION ALL
    SELECT 2 AS [StateID], 'In Progress' AS [StateName]
    UNION ALL
    SELECT 3 AS [StateID], 'Completed' AS [StateName]
    UNION ALL
    SELECT 4 AS [StateID], 'Aborted' AS [StateName]
    UNION ALL
    SELECT 5 AS [OutcomeId], 'To Be Determined (5)' AS [StateName]
    UNION ALL
    SELECT 6 AS [StateID], 'Needs Investigation' AS [StateName]
    SELECT
    TR.[ProjectId] AS [Project Id],
    P.[ProjectName],
    TR.[TestPlanId] AS [Plan Id],
    TP.Name AS [TestPlanName],
    TR.[TestRunId] AS [Run Id],
    TR.[Title],
    S.[StateID] AS [State Id],
    S.[StateName] AS [State],
    TR.[StartDate] AS [Date Started],
    TR.[CompleteDate] AS [Date Completed],
    DATEDIFF(SECOND, TR.[StartDate], TR.[CompleteDate]) AS Duration,
    TR.[Type],
    TR.[IsAutomated],
    TR.[TotalTests] AS [Total],
    TR.[PassedTests] AS [Passed],
    TR.[IncompleteTests] AS [Incomplete],
    TR.[UnanalyzedTests] AS [Unanalyzed],
    TR.[NotApplicableTests] AS [Not Applicable]
    FROM
    [Tfs_DefaultCollection].[dbo].[tbl_TestRun] AS TR
    INNER JOIN [Tfs_DefaultCollection].[dbo].[tbl_Project] AS P ON TR.ProjectId = P.ProjectId
    INNER JOIN [Tfs_DefaultCollection].[dbo].[tbl_Plan] AS TP ON TR.TestPlanId = TP.PlanId
    INNER JOIN cte_State AS S ON TR.[State] = S.[StateID]
    WHERE
    TR.TestRunId IN $($TestRuns)
    ORDER BY
    TR.[StartDate]
    $Command.CommandText = $SQLStatement
    $Command.Connection = $Connection
    $Command.CommandTimeout = 30
    $DataAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
    $DataAdapter.SelectCommand = $Command
    $DataSet = New-Object System.Data.DataSet
    $DataAdapter.Fill($DataSet) | Out-Null
    Write-Output "$SQLStatement" | Out-File -FilePath $LogFile -Append
    # --DEBUG ONLY--> $DataSet.Tables[0]
    return $DataSet
    5. Extract record set of test results from TFS via SQL query:
    # FUNCTION: Retrieve-TestRunResults
    # Parameters:
    # (1.) LogFile -- Name of log file (e.g., C:\Temp or C:\Temp\DEPLOY_DatabaseServer_WebCMS2_DF06_20131031.6.log)
    # (2.) Connection -- Database connection
    # (3.) ListTestRunID -- List of test run identifiers
    Function Retrieve-TestRunResults
    param
    [Parameter(Mandatory=$True)][String]$LogFile,
    [Parameter(Mandatory=$True)]$Connection,
    [Parameter(Mandatory=$True)][String]$ListTestRunID
    Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
    Write-Output "Retrieve test result(s): " | Out-File -FilePath $LogFile -Append
    Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
    $TestRuns = '(' + $ListTestRunID + ')'
    $Command = New-Object System.Data.SqlClient.SqlCommand
    $SQLStatement = "
    WITH
    cte_Outcome
    AS
    SELECT 0 AS [OutcomeId], 'To Be Determined (0)' AS [OutcomeName]
    UNION ALL
    SELECT 1 AS [OutcomeId], 'In Progress' AS [OutcomeName]
    UNION ALL
    SELECT 2 AS [OutcomeId], 'Passed' AS [OutcomeName]
    UNION ALL
    SELECT 3 AS [OutcomeId], 'Failed' AS [OutcomeName]
    UNION ALL
    SELECT 4 AS [OutcomeId], 'Inconclusive' AS [OutcomeName]
    UNION ALL
    SELECT 5 AS [OutcomeId], 'To Be Determined (5)' AS [OutcomeName]
    UNION ALL
    SELECT 6 AS [OutcomeId], 'Aborted' AS [OutcomeName]
    UNION ALL
    SELECT 7 AS [OutcomeId], 'Blocked' AS [OutcomeName]
    UNION ALL
    SELECT 8 AS [OutcomeId], 'Not Executed' AS [OutcomeName]
    UNION ALL
    SELECT 10 AS [OutcomeId], 'Error' AS [OutcomeName]
    UNION ALL
    SELECT 11 AS [OutcomeId], 'Not Applicable' AS [OutcomeName]
    UNION ALL
    SELECT 12 AS [OutcomeId], 'Paused' AS [OutcomeName]
    UNION ALL
    SELECT 13 AS [OutcomeId], 'To Be Determined (13)' AS [OutcomeName]
    UNION ALL
    SELECT 255 AS [OutcomeId], 'Never Run' AS [OutcomeName]
    cte_State
    AS
    SELECT 0 AS [StateID], 'None' AS [StateName]
    UNION ALL
    SELECT 1 AS [StateID], 'Ready' AS [StateName]
    UNION ALL
    SELECT 2 AS [StateID], 'Completed' AS [StateName]
    UNION ALL
    SELECT 3 AS [StateID], 'Not Ready' AS [StateName]
    UNION ALL
    SELECT 4 AS [StateID], 'In Progress' AS [StateName]
    UNION ALL
    SELECT 5 AS [StateID], 'To Be Determined' AS [StateName]
    SELECT DISTINCT
    TR.[TestRunId] AS [Run Id],
    TR.[TestCaseId] AS [Case Id],
    O.[OutcomeID] AS [Outcome Id],
    O.[OutcomeName] AS [Outcome],
    S.[StateID] AS [State Id],
    S.[StateName] AS [State],
    TR.[TestCaseTitle] AS [Title],
    TR.[AutomatedTestName] AS [Automation Method],
    TR.[DateStarted] AS [Date Started],
    TR.[DateCompleted] AS [Date Completed],
    DATEDIFF(SECOND, TR.[DateStarted], TR.[DateCompleted]) AS Duration,
    TR.[FailureType] AS [Failure Type],
    TR.[ErrorMessage] AS [Error]
    FROM
    [Tfs_DefaultCollection].[dbo].[tbl_TestResult] AS TR
    INNER JOIN cte_Outcome AS O ON TR.Outcome = O.OutcomeID
    INNER JOIN cte_State AS S ON TR.State = S.StateID
    WHERE
    TR.TestRunId IN $($TestRuns)
    ORDER BY
    TR.[TestRunId],
    O.[OutcomeName],
    TR.[TestCaseTitle]
    $Command.CommandText = $SQLStatement
    $Command.Connection = $Connection
    $Command.CommandTimeout = 30
    $DataAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
    $DataAdapter.SelectCommand = $Command
    $DataSet = New-Object System.Data.DataSet
    $DataAdapter.Fill($DataSet) | Out-Null
    Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
    Write-Output "SQL Statement: " | Out-File -FilePath $LogFile -Append
    Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
    Write-Output "$SQLStatement" | Out-File -FilePath $LogFile -Append
    # --DEBUG ONLY--> $DataSet.Tables[0]
    return $DataSet
    6. Email results to distribution list  
        Currently, I'm simplifying the extraction of suite path ... replacing hardcoded depth with STUFF() & XML PATH
    Carl.

  • Is there a query to find all software installed on a particular computer through the Add/Remove Programs?

    I am looking for a query to find all software on a specific computer. I have found several on a specific piece of software but I need multiple pieces of software. I have tried creating this query but it shows ALL the software on the computer. I'm looking
    for one that narrows it down to a few pieces of software i.e Office, Adobe, Snagit, IE and Chrome. Possibly using Add/Remove Software? 

    It's an asset intelligence report, do you have that enabled?
    http://technet.microsoft.com/en-us/library/gg699382.aspx
    Alternatively, take a look at the 'Products on a specific computer' report (Software - Companies and Products category) and see if that gets you what you need.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Spatial query to find all partially aligned lines

    Hi There.
    I need to find all partially aligned polylines in the layer (interiors have 1-dimentionali intersection). Actually, polylies may a little fluctuate along each other, but that spatial disjointment shouldn't exceed some certain tolerance. It doesn't matter if polylines are touching each other or cover.
    What spatial operators/functions will you suggest to use to perform that stuff?
    For example next lines for me are partially aligned in tolerance 0.01 (query result is TOUCH):
    select sdo_geom.relate(
    mdsys.sdo_geometry(2002,null,null, mdsys.sdo_elem_info_array(1,2,1), mdsys.sdo_ordinate_array(1,1,4,4)),
    'determine',
    mdsys.sdo_geometry(2002,null,null, mdsys.sdo_elem_info_array(1,2,1), mdsys.sdo_ordinate_array(1.1,1,3.015,3)),
    0.01) relationship
    from dual;
    Note: I can't use buffers because it isn't stable for me :( see: SDO_GEOM.SDO_BUFFER failed with ORA-13050
    Thank you in advance, Denis.

    Thank you for quick response!
    The lines are valid at that tolerance.
    I think that TOUCH+COVERS+COVEREDBY will not be sufficient for me. Because I'm interested in next cases: OVERLAPBDYINTERSECT, INSIDE, CONTAINS, COVERS (any operator which includes overlapping for lines). I can use union of all those masks, but TOUCH will return me many redundant candidates (Often lines are touch but not overlapping, like: (1,1,2,2) VS (2,2,3,3)). The TOUCH works for me if one poliline touches the other and goes along it some time (like I showed above). Hope I was clear :).

  • I have lost my new iPhone. Please help. I have the IMEI no and all the details that comes at the back of the box.

    I have lost my new iPhone. Please help. I have the IMEI no and all the details that comes at the back of the box.

    Having the imei won't help you find your phone.
    If you setup and enabled find my phone prior to losing it then go to icloud.com
    If you didn't set it up - then there nothing you can do.
    Call your carrier and let them know, change all your passwords.

  • Query to find all the view name and their size in GB

    Hi,
    What is the query to find all the view name and their size in GB.I am aware of joining all_views and user_segments but this is not serving the purpose.is there any table i need to join to get the desired result
    Thanks

    You could of course be thinking of views as they are stored in other RDBMS' as some of them actually create the view as a table on the database with a copy of the data in it and maintain that data as the base tables are updated.
    As already mentioned, Oracle just stores the SQL of the View and executes that SQL when the view is queried.
    Alternatively, Oracle also has "materialized views" which are created as snapshots of the data and will have a size. This data is updated (refreshed) based on the parameters used when creating the materialized view which means that it will either be, commonly, when a commit is issued or when a refresh is explicitly requested (refresh on demand).

  • Query to find all tasks on latest published version of a project

    Hello
    Can anybody help me on the query to find all tasks under latest published version of a project?
    Thanks!!

    Do you mean  "All tasks under latest published workplan version"??

  • How to find all photos that have NO faces, as opposed to UNNAMED faces?

    I find that iPhoto often misses faces entirely, especially if the face is wearing sunglasses or a hat or both.  Sometimes it is rather inexplicable that it has missed a face, as the face seems obvious.
    If you use the smart album method to find all "unnamed" faces, the photos have at least one unnamed face identified.  You can then add any missed faces to those photos.
    But what about photos in which iPhoto has failed to identify the existence of even one face?  Or for that matter, if I want to see only pictures of landscapes or objects that have no people?  Does anyone have a method for finding all photos that have no faces in them at all?
    For me, the idea is to find all unidentified faces and add them.  But as I pointed out above, there may be other uses for this.
    Any ideas, anyone?
    Thanks

    Awesome !!! Thank you very much. I did not realize you could use JavaScript to code against iTunes ...
    I don't know if you have written any of these yourself, but do you know how to maybe create a smart playlist with this information via script? If not, no big deal. At least I know have something which I can use, I will just have to run it every so often.
    Thanks again for pointing me to that site!

  • Sql query to find all contacts for an account

    I wonder if someone wrote an sql query to find all contacts for an account number in Oracle customer master. We are on EBS 11.5.10.
    I am also looking for sql query to find all ship to addresses for an account number.
    Thanks.

    Can you also post the query for people who read this post and are also looking for an answer?
    Regards,
    Johan Louwers.

  • Query to find all the suppliers who has their invoices on hold

    Hi All,
    Query to find all the suppliers who has their invoices on hold (at least 1) .
    Thanks,
    Vamshi

    Pls find the script to find the Hold invoies for those suppliers 
    select aps.VENDOR_NAME,aia.INVOICE_NUM,aia.INVOICE_AMOUNT
    from ap_suppliers aps,ap_invoices_all aia,ap_holds_all aha
    where aia.VENDOR_ID = aps.VENDOR_ID 
    and aia.INVOICE_ID = aha.INVOICE_ID 
    and aha.RELEASE_REASON is null
    Thanks
    Hari

  • Query to find all relationships between tables

    Please help me wit the following
    Query to find all relationships between tables
    SAMPLE OUTPUT:
    PRIMTAB PRIMCOL FOREIGNTAB FOREIGN KEY
    DEPT DEPTNO EMP DEPTNO
    Return all records in the database.
    PLEASE HELP

    SET LINESIZE 150
    COLUMN primcol FORMAT A30
    COLUMN foreigncol FORMAT A30
    SELECT uc1.table_name AS primtab,
    ucc1.column_name AS primcol,
    uc2.table_name AS foreigntab,
    ucc2.column_name AS foreigncol
    FROM user_constraints uc1,
    user_constraints uc2,
    user_cons_columns ucc1,
    user_cons_columns ucc2
    WHERE uc1.constraint_name = uc2.r_constraint_name
    AND uc1.constraint_name = ucc1.constraint_name
    AND uc2.constraint_name = ucc2.constraint_name
    AND ucc1.position = ucc2.position
    ORDER BY uc1.table_name,
    ucc1.position
    /

  • I lost my logic 8 pro serial number. I can't find the booklet that comes with the serial number. How can retrieve this? I upgraded from logic pro 7. I changed hard drives and now it keeps asking for the serial number. But I can't find it. Where can I requ

    I lost my logic 8 pro serial number. I can't find the booklet that comes with the serial number. How can retrieve this? I upgraded from logic pro 7. I changed hard drives and now it keeps asking for the serial number. But I can't find it. Where can I request it? Thanks!

    If you still have the receipt or other proof of purchase, you can ask Apple to send you the serial. Otherwise, bad luck mate.. Good news is, you can now buy Logic Pro 9 from App Store for just 199 USD

Maybe you are looking for

  • How to share an external drive?

    hello helpful mac folks! I have a PC networked to my mac, and I am able to see my harddrive from it and share the files on that, but I have recently added a firewire external harddrive to my imac and I would like to be able to access one of the parti

  • How to lock a transaction code  in a report  ?

    Dear Abapers ,      i had a requirement to lock a transaction code in my Module pool programming . the requirement goes in this way .. " if a  single user is editing a report then that particular report has to be accesseble to only that concerned use

  • Time missing from clip view

    Im trying to edit a video for work and i have already gone through and marked time segments to reject clips from becasue of speaking errors. The issue is that in this new version of iMovie i cant figure out a way to view the clip time so i can easily

  • Bind client device to specific platform

    Is there any method how to force a device to register on mobile server as some specific platform? To speak concretely - I have 2 WM5 PDAs on my desk. The first device (Symbol MC70) has XScale CPU, the other has ARMV4 CPU (Acer n300). I used the same

  • Sub-tables/Flow dimension - NETVAR

    Hi all Does anybody know what it means if a particular value in the  the Sub-tables/Flow dimension has a FLOW_TYPE of  NETVAR ? Regards Byron