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.

Similar Messages

  • Sql query to find the balances for a customer account wise.

    Hi,
    Could someone help me with the sql query to find the balances for each customer account wise. This is need to generate the report.
    presently we are using this query, but the output doesnot return the expected result.
    SELECT sum(nvl(ps.acctd_amount_due_remaining,0)) "Balance"
    FROM      ra_cust_trx_line_gl_dist_all gld,
              gl_code_combinations c,
              ar_payment_schedules_all ps,
              RA_CUSTOMER_TRX_ALL rat,
              ra_customers rc
    WHERE      c.CHART_OF_ACCOUNTS_ID = 101
    and gld.code_combination_id = c.code_combination_id
         and rat.CUSTOMER_TRX_ID=gld.CUSTOMER_TRX_ID
         and rat.CUSTOMER_TRX_ID=ps.CUSTOMER_TRX_ID
    and ps.customer_id=rc.customer_id
         and ps.status='OP'
         and ps.gl_date <= :PDATE
         and ps.org_id=:PORGID
         and ps.class in ('GUAR','INV','DM','DEP')
    and c.SEGMENT4=:Account_id
    and ps.customer_id=:Customer_id
    Thanks in advance.
    Kalyan.

    Can someone help us with this.

  • SQL Query to find cumulative values for a Financial Year

    Dear users,
    My requirement is to create a SQL query for a table/view where I have day-wise data. I want to find out cumulative values for financial year by giving any date. It should add the values from start of financial year till that date in the financial year.
    I think creating a view of such type will post heavy burden on resources since accuimulation will be done for each day upto that day.
    Thanks

    Dear users,
    My requirement is to create a SQL query for a
    table/view where I have day-wise data. I want to
    find out cumulative values for financial year by
    giving any date. It should add the values from start
    of financial year till that date in the financial
    year.
    I think creating a view of such type will post heavy
    burden on resources since accuimulation will be done
    for each day upto that day.
    ThanksKumar's solution will serve yours purpose but m not agreed
    I think creating a view of such type will post heavy
    burden on resources since accuimulation will be done
    for each day upto that day. Khurram

  • SQL query to find all responsibilities containing a given submenu?

    Ok, I've searched all over this place and I can't quite get what I want. I can get all responsibilities with a given function, and I can get all responsibilities with a given menu, but I can't get all responsibilities with a given SUBmenu. Specifically, I'm trying to get all responsibilities that have "Desktop Integration Menu" somewhere in their menu tree, whether it be menu or submenu. All I can do is get the ones where it's the menu (i.e. the seeded Desktop Integration responsibilities). Can anyone give me some assistance with this query? It's driving me nuts. Below is the SQL query as it stands now. Thanks!
    SELECT DISTINCT frt.responsibility_name, fmt.user_menu_name, fr.menu_id,fme.sub_menu_id
    FROM apps.fnd_responsibility_tl frt,
    apps.fnd_responsibility fr,
    apps.fnd_menus_tl fmt,
    apps.fnd_menus fm,
    apps.fnd_menu_entries fme
    WHERE frt.responsibility_id(+) = fr.responsibility_id
    AND fr.menu_id = fmt.menu_id
    AND fr.menu_id = fm.menu_id
    AND fme.sub_menu_id = fr.menu_id
    AND frt.LANGUAGE = 'US'
    AND fr.end_date IS NULL
    AND sub_menu_id = '1004193'
    ORDER BY frt.responsibility_name ASC

    Please see these docs.
    How To get List Of Functions Which Are Setup For A Responsibility? [ID 549100.1]
    How to identify all Menus / Responsibilities Associated with a Given Function [ID 238653.1]
    Script To Extract Submenu And Function Information About A Menu [ID 458701.1]
    HOW TO GENERATE MENU TREE FOR A MENU ATTACHED TO A RESPONSIBILITY IN ORACLE APPLICATIONS 11i ? [ID 312014.1]
    Thanks,
    Hussein

  • 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.

  • Query to find all dependencies for a lookup type

    I have a lookup type and i need to find all the concurrent programs using it.

    Need dependencies for a particular Flexfield structure too.. pls help !!

  • SQL query to find all the custom folders in Discoverer (query posted)

    I know its not a question I am posting..this is just to inform community users that this query makes life easier in case someone wants to find out all the custom folders in a particular EUL (folder name starting with XX)
    select b.ba_name,f.obj_name folder_name,f.obj_id,f.obj_ext_owner Owner
    from
    APPS.EUL5_objs f
    , APPS.EUL5_ba_obj_links l
    , APPS.EUL5_bas b
    where 1=1
    and f.obj_id= l.bol_obj_id
    and b.ba_id= l.bol_ba_id
    and b.ba_name like 'XX%'
    order by b.ba_name,f.obj_name;
    Hopefully it would be useful to others!

    Connect as sysdba and try..
    To list all objects >100M in size.
    SQL> select owner, segment_type, segment_name, sum(bytes)/(1024*1021) from dba_segments
    group by owner, segment_type, segment_name
    having sum(bytes)/(1024*1021) > 100
    For tablespaces ..
    select tablespace_name, sum(bytes) tablespace_size
    from dba_data_files
    group by tablespace_name
    union all
    select tablespace_name, sum(bytes) tablespace_size
    from dba_temp_files
    group by tablespace_name
    order by tablespace_name

  • SQL Query to Find out User has what all resources provisioned !

    Hi Guys ,
    Does any one have a SQL query to find out what resources are provisioned to a particular user ?
    Thanks
    Suren

    Hi,
    Hope this will help you.
    SELECT distinct usr_login as "IdM User ID",
    usr_employeeID as "Employee ID",
    usr.USR_FIRST_NAME as "First Name",
    usr.USR_LAST_NAME as "Last Name",
    usr_status
    as "User Status",
    USR_EMP_TYPE as "Employee Type",
    obj.obj_name as "Application Resource",
    ost_status as "Application Resource Status",
    FROM ost,oiu,obj,usr,obi
    WHERE oiu.ost_key = ost.ost_key AND obj.obj_key = obi.obj_key AND oiu.usr_key = usr.usr_key
    AND ost_status in ('Provisioned','Revoked','Disabled', 'Provisioning')
    AND oiu.obi_key=obi.obi_key
    AND usr_EmployeeID like '11111'
    This query will provide all the resources to which the user is linked with and the resource status is in 'Provisioned','Revoked','Disabled', 'Provisioning' status for a particular employeed ID, I am not completely sure whether I have given the Employee ID column from USR table as correct or not. Verify once and query the DB

  • Can anybody provide the SQL query to find the files uploaded in a particular folder?

    Hi All,
    Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
    GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
    Any help is greatly appreciated.
    With best regards,
    Nevin

    Nevin,
    Be great if we could know the version of Portal. For Rel. 1, here's the query
    select id,masterthingid from wwv_things
    where siteid = &site
    and cornerid = &corner
    &site - Content Area id
    &corner - Folder id
    if you don't know the folder id, use
    select id from wwv_corners where siteid = &site
    and name = &folder
    Hope this helps. I have run into this situation before. Usually, the culprits were
    one of the following:
    1. Junk Characters in description of item (caused due to Copy-Paste)
    2. Special Characters in the File name
    Hi All,
    Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
    GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
    Any help is greatly appreciated.
    With best regards,
    Nevin

  • SQL Query to find menus and submenus attached to responsibility

    Hi,
    I am looking for help to find out a sql query to pull out the list of all the menu's associated with each of the responsibilities assigned to users. Please let me know any SQL query to find out menus attached for responsibilities assigned to users.

    835129 wrote:
    I was asked by my lead to list out responsibilities and attached menus and I was asked to submit the output from production. In the metalink note provided by you it was asked to create table collecting all menu id's and I cannot create any tables in production. Apart from this there were 1000's of users with different responsibilities and different menus. I cannot collect all of the users menu ids.
    I just want to list out responsibilities and attached menus. Is that something you can helpout withhttps://forums.oracle.com/forums/search.jspa?threadID=&q=fnd_responsibility_vl+AND+fnd_menu&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    https://forums.oracle.com/forums/search.jspa?threadID=&q=fnd_responsibility_tl+AND+FND_MENU_ENTRIES_TL&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Please search the forum for these tables/views and you should get many hits:
    FND_MENU_ENTRIES_TL
    FND_MENU_ENTRIES_VL
    FND_RESPONSIBILITY_TL
    FND_RESPONSIBILITY_VL
    Thanks,
    Hussein

  • SQL query to find sqlnet.ora parameters

    Hi All,
    I am working 11g RAC /solaris 9
    I want have sql query to find values of sqlnet.ora parameters
    May be values of SQLNET.INBOUND_CONNECT_TIMEOUT
    SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT
    Thanks
    raj

    The sqlnet.ora file is the profile configuration file. It resides on the client machines and the database server.
    Profiles are stored and implemented using this file. The database server can be configured with access control parameters in the sqlnet.ora file.
    These parameters specify whether clients are allowed or denied access based on the protocol.
    The sqlnet.ora file enables you to do the following:
    Specify the client domain to append to unqualified names
    Prioritize naming methods
    Enable logging and tracing features
    Route connections through specific processes
    Configure parameters for external naming
    Configure Oracle Advanced Security
    Use protocol-specific parameters to restrict access to the database
    By default, the sqlnet.ora file is located in the ORACLE_HOME/network/admin directory. The sqlnet.ora file can also be stored in the directory specified by the TNS_ADMIN environment variable.
    You can not query on this file sqlnet.ora as tnsnames.ora file.
    Regards
    Mahir M. Quluzade

  • Correlated query to find cheapest manufacturer for a product

    Hi,
    I have a SQL Query that returns me:
    - the "product code" i must purchase,
    - the "quantity" to purchase for this product
    - and if it's in "promotion or not".
    Based on this result, i must to look at "manufacturer" table and find the cheapest "price" for each product to purchase and the quantity available at the manufacturer.
    If "quantity to order" (e.g. 20) is higher than "quantity available" (e.g. 12) at "cheapest manufacturer", i must order the missing quantity (8) to the next cheapest manufacturer.
    How can i do that ?
    thx

    ​Hi
    >>correlated query to find cheapest manufacturer for a product
    I have created two table [ProdTable] , [Product Code] to get the cheapeast manufacturer  for a product  which you can refer to .
    [Product Table]
    [Prod Table]
    select [ProdTable].[S_Prod_Code],Min([ProdTable].[Prod_Cost]) as MiniCost
    from [ProdTable] inner join [Product Table] on [ProdTable].[S_Prod_Code]=[Product Table].[Product Code]
    Where [Product Table].[Promotion]<>"YES"
    group by [ProdTable].[S_Prod_Code]
    Using the above query ,you can get the cheapest  cheapeast manufacturer  for a product , which the promotion is not YES
    >>for promotional products, i must firstly check if the cheapest manufacturer has enough prod in stock. If not, i order all the prod in stock the manufacturer has, and i must order to missing ones to the next cheapest manufacturer
    Are you looking for a select query or an update to the table or form design ?Can you separate your business rules with the technolege ?  So more people could understand your issues well to give you more help.
    Thanks for your understanding
    Best Regards
    Lan
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • SQL Query to retriew open GRNs for Purchasning in R12

    Hi All,
    Can anybody help me by providing an SQL Query to retrieve all open GRNs in purchasing. As a part of re-implementation we are loading open balance from the existing system. In order to validate the open GRNs standard report is not apt results.
    Thanks & Regards,
    Sadanand

    Hi Sadanand,
    select
    pv.vendor_id,
    pv.segment1 vendor_num,
    pv.vendor_name,
    pvs.vendor_site_id,
    pvs.address_line1||', '||
    pvs.address_line2||', '||
    pvs.address_line3||', '||
    pvs.address_line4||', '||
    pvs.area_code||', '||
    pvs.city||', '||
    pvs.country ||' - '||
    pvs.zip vendor_address,
    (select organization_code from org_organization_definitions
    where pll.ship_to_organization_id = organization_id) org,
    msi.segment1||'.'||
    msi.segment2||'.'||
    msi.segment3||'.'||
    msi.segment4 item_code ,
    msi.description item_desc,
    msi.primary_unit_of_measure uom,
    pll.quantity qty_ordered,
    (nvl(pll.quantity,0) - nvl(pll.quantity_received,0) - nvl(pll.quantity_cancelled,0)) qty_due,
    -- pod.quantity_delivered,
    poh.segment1 po_num,
    pol.line_num,
    pll.shipment_num,
    pll.need_by_date,
    pol.unit_price,
    jip.tax_line_no,
    jit.tax_name,
    jip.tax_rate,
    jip.tax_amount,
    hrl.location_code shipping_loc
    from
    po_headers_all poh,
    po_lines_all pol,
    po_line_locations_all pll,
    po_distributions_all pod,
    mtl_system_items msi,
    po_vendors pv,
    po_vendor_sites_all pvs,
    ja_in_po_line_location_taxes jip,
    ja_in_tax_codes jit,
    hr_locations_all_tl hrl
    where
    poh.org_id = :p_org_id
    and poh.authorization_status = 'APPROVED'
    and poh.closed_code = 'OPEN'
    and pol.po_header_id = poh.po_header_id
    and ( pol.closed_code = 'OPEN' or pol.closed_code = 'OPEN FOR RECEIVING' or pol.closed_code is null )
    and pll.po_line_id = pol.po_line_id
    and (nvl(pll.quantity,0) - nvl(pll.quantity_received,0) - nvl(pll.quantity_cancelled,0)) > 0
    and ( pll.cancel_flag = 'N' or pll.cancel_flag is null )
    and pod.line_location_id = pll.line_location_id
    and msi.inventory_item_id = pol.item_id
    and msi.organization_id = pll.ship_to_organization_id
    and pv.vendor_id = poh.vendor_id
    and pvs.vendor_site_id = poh.vendor_site_id
    and jip.line_location_id = pll.line_location_id
    and jip.po_line_id = pll.po_line_id
    and jip.po_header_id = pll.po_header_id
    and jit.tax_id = jip.tax_id
    and hrl.location_id (+) = pll.ship_to_location_id
    order by poh.segment1 ,
    pol.line_num ,
    pll.shipment_num ,
    jip.tax_line_no
    Regards
    sanjay

  • SQL query  which return all the NET SERVICES which are avaiable in tnsname

    hi all
    how to write a sql query which return all the net services which are avaiable in tnsname.ora
    Regards
    s

    Also, tnsnames.ora is stored on the client, and not necessarily on the server; it's possible (and quite likely) that the name I use for a database in my tnsnames.ora could be different from the name you use for the same database; conversely we might use the same name for two different databases.
    Regards Nigel

  • SQl query to find incompatibility defined

    If two programs are defined as incompatible with one another, the data these programs cannot access simultaneously must also be identified.
    This can be found from concurrent program->define from front end ebs login, but is there any SQL query to find this for a particular program or request set??
    Thanks in advance.

    Please search the forum before posting similar questions.
    Concurrent-Conflict
    Re: Concurrent-Conflict
    Thanks,
    Hussein

Maybe you are looking for

  • How can I change the country associated with my Adobe ID?

    mon statut de compte de mon forait actuel est Adobe Export PDF Annuel est désactivé à cause que l'adresse de facturation est automatiquement lié avec la Belgique et pas avec la France... comment modifier????

  • Process and button how to?

    How i can to know in process, what button was pressed on the Form

  • Unable to click on images to make them larger

    On clicking on the small images on that famous auction site *bay the images should get larger, but they dont.   Tried it on Safari and Firefox both the same, dont think anything else is wrong

  • Issues with download

    Please I am trying to download with my blackberry 9900 but I keep getting info saying cookies disabled from your browser but I have checked accept cookies yet I keep getting same message, what do I do? .

  • Hacked By OurMine Team!!

    Hacked By OurMine Team!!