Recursive select in user_constraints

I have 5 tables (or more) in master detail relation (five levels). Is possible to write recursive select cross user_constraints table to get all this levels from select?
my wrong try:
select table_name,R_CONSTRAINT_NAME,CONSTRAINT_NAME from user_constraints a
where a.R_CONSTRAINT_NAME is not null
connect by prior a.CONSTRAINT_NAME=a.r_CONSTRAINT_NAME start with a.R_CONSTRAINT_NAME='ZMPTDOPO_PK';

Something like this ?
SQL> select table_name,constraint_name, r_constraint_name
  2  from user_constraints
  3* order by table_name
SQL> /
TABLE_NAME                     CONSTRAINT_NAME                R_CONSTRAINT_NAME
TABLE1                         TABLE1_PK
TABLE2                         TABLE2_PK
TABLE2                         TABLE2_FK                      TABLE1_PK
TABLE3                         TABLE3_PK
TABLE3                         TABLE3_FK                      TABLE2_PK
TABLE4                         TABLE4_PK
TABLE4                         TABLE4_FK                      TABLE3_PK
TABLE5                         TABLE5_PK
TABLE5                         TABLE5_FK                      TABLE4_PK
9 rows selected.
SQL> col lev for a10
SQL> select lpad(level,level,' ') lev, parent_table, child_table
  2  from (select a.table_name child_table, b.table_name parent_table
  3  from user_constraints a, user_constraints b
  4  where a.r_constraint_name = b.constraint_name)
  5  start with parent_table = 'TABLE1'
  6* connect by prior child_table = parent_table
SQL> /
LEV        PARENT_TABLE                   CHILD_TABLE
1          TABLE1                         TABLE2
2         TABLE2                         TABLE3
  3        TABLE3                         TABLE4
   4       TABLE4                         TABLE5
SQL>                                                                                           

Similar Messages

  • Recursive selection sort stack overflow

    hi, first time posting here.
    i have to write a java method that implements a selection sort. This method must be recursive. ok not a problem. i have come up with this so far
        public int findMin(int index) {
            int min = index - 1;
            if (index < num.length - 1) min = findMin(index + 1);
            if (num[index] < num[min]) min = index;
            return min;
        public void selectionSort(int left) {
            if (left < num.length - 1) {
                swap(left, findMin(left));
                selectionSort(left + 1);
        public void swap(int index1, int index2) {
            int temp = num[index1];
            num[index1] = num[index2];
            num[index2] = temp;
        }which works fine until i toss in a lot of values into the array. this creates a stack overflow, and ive been told that i need to use the divide and conquer method of resolving this issue. I guess this means to split the array up and sort each half seperatly, again and agin, or so im told.
    My question is how do i go about doing this, i am at a loss. Any help at all would be great.
    thank you
    lance

    i get this when i push the array passed about 5500 in sizeI got no problem. Post a small demo code that is generally compilable, runnable and could reproduce your problem. See: http://homepage1.nifty.com/algafield/sscce.html and http://www.yoda.arachsys.com/java/newsgroups.html
    It is silly to implement selection sort with recursion, double-silly if you use double-recursion as your current code.
    /* silly but no OOME when used against 5500 element array */
    import java.util.*;
    public class RecursiveSelectionSort{
      static int[] num;
      public static int findMin(int index) {
        int min = index; // your code had a bug here
        if (index < num.length - 1){
          min = findMin(index + 1);
        if (num[index] < num[min]){
          min = index;
        return min;
      public static void selectionSort(int left) {
        if (left < num.length - 1) {
          swap(left, findMin(left));
          selectionSort(left + 1);
      public static void swap(int index1, int index2) {
        int temp = num[index1];
        num[index1] = num[index2];
        num[index2] = temp;
      public static void main(String[] args){
        Random rand = new Random();
        int n = 10;
        if (args.length > 0){
          n = Integer.parseInt(args[0]);
        num = new int[n];
        for (int i = 0; i < num.length; ++i){
          num[i] = rand.nextInt(10000);
        selectionSort(0);
        for (int in : num){
          System.out.print(in + " ");
        System.out.println();
    }

  • How to write a recursive select procedure to read hierarchial data?

    Hi!
    I have a database where two tables are of interest to me.
    TABLE1
    ITEM_ID
    TABLE2
    PARENT_ID
    CHILD_ID
    There is a constrant between the tables so parent_id and child_id must exist in TABLE1 (they are actually same objects as those defined in TABLE1 using PK ITEM_ID)
    This table design is used to create tree structures. But I ahve hit a bump in the road on how to create a procedure that give me the entire structure as a recordset.
    Basically I just want to execute the procedure and I should be able to see the hierarchy, pergaps by appending pipe characters... like
    |Node1
    ||Node11
    |||Node111
    ||Node12
    |||Node121
    |Node2
    Later in my web app I will create a word like document using this information. But first I just need to list the structure from a specific parent.
    Do you perhaps have an idea how to create such a procedure? It should have at least 1 input parameter and that is the start parent. Then it should perhaps work in a recursive manner.
    Im very sure this has been done before, but I have not found a good example using the table design as stated above.
    kind regards
    Henrik

    Please read about [url http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/queries4a.htm#2053937]Hierarchical Queries in the manual.

  • Recursive select?

    I have a table like following
    CRN Service_Code
    25 SM
    25 SP
    25 SN
    26 SP
    26 SM
    I want result like
    25 SM,SP,SN
    26 SP,SM
    I have a query for this like:
    Select CRN,
    max(case when service_code='SP' then service_code else null end) ||','||
    max(case when service_code='SM' then service_code else null end) ||','||
    max(case when service_code='SN' then service_code else null end)
    from Table1
    group by CRN;
    Is there any efficient way to acheive this rather than hardcoding the service codes???

    Hallo,
    SELECT crn,
           MAX(substr(SYS_CONNECT_BY_PATH(service_code,','),2))
    FROM   (SELECT crn, service_code,
                   ROW_NUMBER() OVER (PARTITION BY crn ORDER BY service_code) curr
            FROM   scott.tbl_crn)
    GROUP BY crn
    CONNECT BY curr = PRIOR curr + 1 AND crn = PRIOR crn
    START WITH curr = 1;CRN MAX(SUBSTR(SYS_CONNECT_BY_PATH
    25      SM,SN,SP
    26      SM,SP
    But only from Oracle 9i!
    Regards
    Dmytro

  • Procedure with recursive query working in 11g compiles with error in 10g

    Hi, All,
    I have a procedure that recursively selects tree-like table (with ID-ParentID relationship). Query itself works perfectly and exactly like I need in 11g and procedure containing it compiles well. But when I try to create the same procedure in 10g then I get a message that procedure compiled with error. I have no other suspicions but on the WITH part of the procedure.
    The exact query is here (destination_tariff_zones is the tree-like table which refers to itself by parent_destination_tariff_zone_id):
    + open dtzl_cur FOR
    with dtree (nm, iid, alevel, wldcard, dtzindex)
    as (select dtz.iname, dtz.iid, 0, dtz.wildcard, rcdi.iindex
    from destination_tariff_zones dtz, rating_cube_dimension_indices rcdi, rating_cube_dimensions rcd
    where dtz.parent_tariff_zone_id is null and
    dtz."rc_dimension_index_id" = rcdi.iid and
    rcdi."rc_dimension_id" = rcd.iid and
    rcd.rating_cube_id = rc_id and
    rcd.dimension_type_id = dim_type
    union all
    select dtz.iname, dtz.iid, dtree.alevel + 1,
    cast ((dtree.wldcard || dtz.wildcard) as varchar2(20)), rcdi.iindex
    from dtree, destination_tariff_zones dtz, rating_cube_dimension_indices rcdi, rating_cube_dimensions rcd
    where dtree.iid = dtz.parent_tariff_zone_id and
    dtz."rc_dimension_index_id" = rcdi.iid and
    rcdi."rc_dimension_id" = rcd.iid and
    rcd.rating_cube_id = rc_id and
    rcd.dimension_type_id = dim_type)
    select iid, nm, wldcard, dtzindex
    from dtree
    order by wldcard;+
    Is there any difference between how 11g and 10g handle WITH statements?
    Please advise.
    Thank you very much in advance,
    Max

    Max Afanasiev wrote:
    then is there any alternative to implement what I need?You can look at using CONNECT BY to emulate a recursive query. If you can post the following we may be able to help:
    1. Sample data in the form of CREATE / INSERT statements.
    2. Expected output
    3. Explanation of expected output (A.K.A. "business logic")
    4. Use \ tags for #2 and #3. See FAQ (Link on top right side) for details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Get-ADGroupMember -recursive Show Groupnames

    I'm new to Powershell and im trying to get a list of the Members of some AD-Groups. Each Group is related to two other Groups for Read and Change permissions. Like FS101_EXAMPLE has two members wich are FS101_EXAMPLE_C and FS101_EXAMPLE_R
    So far I've got the following Code:
    import-module ActiveDirectory
    $GRP = "Groupname"
    Get-ADGroupMember $GRP -recursive | select objectclass,name | export-csv C:\Scripts\Exports\$(get-date -f yyyy-MM-dd-hh-mm-ss)-$GRP.txt –NoTypeInformation -Encoding UTF8
    If i scan on "FS101_EXAMPLE" it works and i get a list of all Members of FS101_EXAMPLE_C and FS101_EXAMPLE_R but i should know how's in wich group.
    How can I get a List with the Groupnames on it?

    If I understand you correctly, it sounds like you're getting the list of members from FS101_EXAMPLE, and recursively returning the members of groups within this first group. Your output lists the users but doesn't distinguish from which group they belong.
    I'm looking at Get-ADGroupMember and I see this behavior as well. I have ADPrincipal objects but there's not way on the surface to see their group membership.
    There are likely a number of ways to reach your goal, here is one way using a recursive function.
    function Get-ADGroupMembers {
    param(
    [string]$GroupName
    $objects = @()
    $members = Get-ADGroupMember -Identity $GroupName
    foreach ($member in $members) {
    if ($member.objectClass -eq "group") {
    $objects += Get-AdGroupMembers -GroupName $member.Name
    $objects += @{
    "objectclass" = $member.objectClass;
    "name" = $member.Name;
    "group" = $GroupName
    } # foreach
    return $objects
    } # Get-AdGroupMembers
    Import-Module ActiveDirectory
    $GRP = "Groupname"
    $AllMembers = Get-ADGroupMembers -GroupName $GRP
    $AllMembers | Foreach-Object {New-Object psobject -Property $_ } | Export-Csv C:\Scripts\Exports\$(get-date -f yyyy-MM-dd-hh-mm-ss)-$GRP.txt –NoTypeInformation -Encoding UTF8
    What I'm doing here is I've created a recursive function Get-ADGroupMembers (maybe not the best name) that calls Get-ADGroupMember against the given group. It then gets the members, collects the properties we want and adds them to an array which the function
    returns. If there is a group in the group, it will call the function again with this subgroup. 
    I'm storing the properties you want, objectClass, and Name, as well as the name of the group in a hashtable. The function returns the array of hashtables which I then convert to an object and export to CSV (HT powershell
    convert array of hastables into csv).
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • Unable to remove recycle bin entries from user_constraints table

    When I do select * from user_constraints table I get few entries like BIN$HY86N3B2RQi/1ODAiR9CTw==$0.
    I have tried purging the recycle bin many times but these entries are still there. When i try to read the database information from my code(JDBC Connection) these keys are being read and generating erroneous results.
    One more important thing. When i tried to rename these keys, they are getting generated again. Any help on this issue will be very helpful to me. Thanks in advance.

    >
    When i tried to rename these keys, they are getting generated again
    >
    What does this mean? Show us the statement you used to do the rename.
    >
    its not present in the recycle bin but it is present in the table user_constraints only. when i do a select * from user_constraints i get two entries where the constraint_name is like this BIN$.........
    >
    Exactly - once you flashback the table the constraints aren't in the recycle bin so you can't purge them from it. But you can rename these if you own them. You don't have to be SYS.
    See the 'Notes on Flashing Back Dropped Tables in the SQL reference
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9012.htm
    >
    Notes on Flashing Back Dropped Tables The following notes apply to flashing back dropped tables:
    •Oracle Database retrieves all indexes defined on the table retrieved from the recycle bin except for bitmap join indexes. (Bitmap join indexes are not put in the recycle bin during a DROP TABLE operation, so cannot be retrieved.)
    •The database also retrieves all triggers and constraints defined on the table except for referential integrity constraints that reference other tables.
    The retrieved indexes, triggers, and constraints have recycle bin names. Therefore it is advisable to query the USER_RECYCLEBIN view before issuing a FLASHBACK TABLE ... TO BEFORE DROP statement so that you can rename the retrieved triggers and constraints to more usable names.
    •When you drop a table, all materialized view logs defined on the table are also dropped but are not placed in the recycle bin. Therefore, the materialized view logs cannot be flashed back along with the table.
    •When you drop a table, any indexes on the table are dropped and put into the recycle bin along with the table. If subsequent space pressures arise, then the database reclaims space from the recycle bin by first purging indexes. In this case, when you flash back the table, you may not get back all of the indexes that were defined on the table.
    >
    Just rename the constraints since they are in your own schema.

  • Looking for System Tables / Views like in Oracle DB - user_constraints, user_tab_columns, ...

    Hello,
    I'm looking for system tables or views like in the Oracle Database.
    First I'm looking for running /active sessions - like v$sessions or in an RAC environment gv$session
    And get the corresponding SQL from v$sql
    Second I had problems to drop tables due to constraints.
    Therefore I was looking for dba_constraints, all_constraints or user_constraints
    select * from user_constraints WHERE constraint_type in ('R');
    With that information I'm able to generate a script to drop the constraints.
    Third I want quick lookup about data types used in a table to correct my settings in Oracle BI.
    For example which column in which table of my schema uses the datatype BIGINT.
    If only 3 attributes in  two tables out of 100 use the BIGINT datatype - I'm able to quickly change my settings in the OBIEE repository.
    I'm missing a table like user_tab_columns.
    How can I get the same information out of TimesTen ?
    Thanks in advance,
    Thorsten

    Hi Thorsten,
    You should be able to get some of the information that you want from the TimesTen reports that are in SQL Developer.
    e.g.
    <TimesTen Reports -> Table -> Columns -> Columns> returns a listing of all the columns and their data types. You can order by the data type column or add a filter (say ='TT_BIGINT') to restrict the result set.
    <TimesTen Reports -> Table -> Constraints -> All Constraints / FK Constraints / PK Constraints / Unique Constraints>  returns a listing of all the constraints, their name, the table that the constraints are on, and their properties.
    For all the SQL Developer reports, you will be able to see the underlying queries and the TimesTen system tables/ views that they reference.
    Simon

  • How do I search a spreadsheet for a list of URL's | then search those URL's for keywords | save the output? (Oh yeah..., and schedule it)

    Fist, I should mention I am not a programmer but am eagerly learning powershell!
    I am looking for an automated solution to accomplish what I am currently doing manually.  I need a script that would combine the following:
    Reach out to a list of websites (probably a loop of some sort since the list will come out of a spreadsheet which could contain 1 or 100 different sites)
    Search each page for a specific word or words (not contained in the spreadsheet though that may make it more scalable)
    Save the URL of the site(s) that contained the keywords to one text file (versus the multiple .html files I am creating today)
    Have the output contain which words it found on which site.
    If not overly complicated, I would like to schedule this to recur once a week.
    A working script would be ideal, but even the resources that show me how to incorporate each element would suffice.
    I have had success pulling down the full content of the listed pages and saving them to a directory, which requires manual intervention.
    So far this works, but it's not scalable:
         Set-ExecutionPolicy RemoteSigned
         $web = New-Object Net.WebClient
         $web.DownloadString("http://sosomesite/54321.com") | Out-File "C:\savestuffhere\54321.html"
         $web.DownloadString("http://sosomesite/54321.com") | Out-File "C:\savestuffhere\65432.html"
         Get-ChildItem -Path "C:\savestuffhere\" -Include *.html -Recurse | Select-String -Pattern "Keyword 1"
    In otherwords, I have to manually replace the "http://sosomesite/54321.com" and "C:\savestuffhere\54321.html" when the URL changes to .\65432.com and the output name to match.  That works fine when it's a couple sites, but again,
    is not scalable.  
    Then, to see if any of the saved file's contain the keyword(s), I have to search the directory for the keyword which I am using:
    Get-ChildItem -Path "C:\savestuffhere\54321.html" -Include *.html -Recurse | Select-String -Pattern "Keyword 1"

    Hi Sure-man,
    Sorry for the delay reply.
    To automatically Reach out to all urls, you can list all urls in a txt file "d:\urls.txt" like this:
    http://sosomesite/54321.com
    http://sosomesite/65432.com
    Then please try the script below to save the URL of the site(s) that contained the keywords to one text file "d:\outputurls.txt":
    $urls = get-content d:\urls.txt
    foreach($url in $urls){
    $results = $web.DownloadString("$url")
    $matches = $results | Select-String -Pattern "keyword1","keyword2"
    #Extract the text of the messages, which are contained in segments that look like keyword1 or keyword2.
    if ($matches.Matches){
    $Object = New-Object PSObject
    $Object | add-member Noteproperty keyword $matches.Matches.value
    $Object | add-member Noteproperty URL $url
    $output+=$Object}
    $output|Out-File d:\outputurls.txt
    If you want to schduled this script in Task Scheduler once a week, please save the script above as .ps1 file, and follow this article:
    Weekend Scripter: Use the Windows Task Scheduler to Run a Windows PowerShell Script
    If I have any misunderstanding, please let me know.
    I hope this helps.

  • How to find out the primary key of oracle apps tables

    Hii,,
    My Question is How to find the primary key in the apps table...Is there any Query or other way to find out???
    for eg.
    I want to find out the primary key of the AP_INVOICES_ALL table...just tell me how can i get the primary key of this table.
    I am currently using toad for the query..
    Please guide me...

    you can define the primary key when you create table
    or add the primary key after the table creation by 'ALTER TABLE ... ADD constraint pk_nme primary key (col1, col2)';
    you could use below sql to check the detail of primary key:
    1) check out the table definition directly:
    select dbms_metadata.get_ddl('TABLE','EMP') FROM DUAL;
    2) check out the columns of primary key:
    select * from user_constraints where constraint_type='P' AND table_NAME='EMP';
    select * from user_cons_columns where CONSTRAINT_NAME='PK_EMP';And BTW, it is madam, not sir. :)
    Edited by: PhoenixBai on Dec 17, 2010 1:07 PM

  • SQL loader and commit

    Hi,
    I am trying to execute a sql loader script that populates many tables. The order of the tables in the script is very important because the table of the last table has a constraint with the first table of the script. So I need that sqlloader executes a commit after the filling of the first tables because if sql loader executes the script simply as it is written the last tables launches an error because the constraint is violated (the last table sees the first one empty).
    How can I force a commit after a filling in sql loader?
    The sctructure of the tables was not defined by me so I must not modify it (constraint included).
    Thanks, bye bye.

    Hi,
    If you have to enable/disable manually the constraints you can execute:
    DECLARE
      v_ds_action VARCHAR2(7);
    BEGIN
      v_ds_action := 'DISABLE';
        FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'R') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
      FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'C') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
    FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'U') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
      FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'P') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
    END;
    DECLARE
      v_ds_action VARCHAR2(7);
    BEGIN
      v_ds_action := 'ENABLE';
      FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'P') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
      FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'U') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
      FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'C') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
      FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'R') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
    END;
    /Regards,

  • How to change all fk constraints in schema to refer to different schema

    Hi,
    We wish to change all the fk constraints which point to tables on one schema to same table names but owned by a different schema.
    Is this possible?
    Thinking of query user_constraints
    select *
    from user_constraints r
    where r.constraint_type = 'R'
    and r.r_owner = 'REF'
    can put this inside loop but can you modify fk constriant to refer to table owned by different schema
    11.2.0.3
    Don't really want to need to drop and recreate.
    Thanks
    Edited by: user5716448 on 06-Apr-2012 04:26

    Yes. You need to drop the constraint and recreate it using the clause 'new_schema.objct_name' in the constraint creation statement.
    For example, if you want to change the constraint cons_1 to point to some column col_1 in schema sch_2 then the sequence of statements will be like,
    ALTER TABLE TAB_1 DROP CONSTRAINT CONS_1;
    ALTER TABLE TAB_1 ADD CONSTRAINT CONS_1 FOREIGN KEY COL_1 REFERENCES SCH_2.TAB_1(COL_1);
    Remember, you have to have all the privileges required to use/reference the table in schema_2.

  • How to list the Cert Issuer for all servers in a Domain

    Hello,
    The objective is to list the Server name and Cert Issuer for any Cert found in the LocalMachine\My store on all servers in a Domain.
    Once I'd get to a server, probably by PS remoting, I'd issue the following:
    dir cert:\localmachine\my -recurse | ? Issuer -like '*'
    However, the output is Thumbprint and Subject, but I really need to see the Issuer, or what is displayed in the Certificates MMC under the 'Issued By' column.  What I need in my output is the following:
    ComputerName       Issuer
    Srv1                       Acme Cert Auth
    Srv2                       Host1.Acme.Com
    Any suggestions would be appreciated.
    Thanks for your help! SdeDot

    As you might suspect it is even easier than that:
    $omputers |
    ForEach-Object{
    invoke-command -ComputerName $_ -ScriptBlock {dir cert:\localmachine\my -recurse}
    } |
    select PSComputerName, Issuer
    ¯\_(ツ)_/¯
    Indeed.
    =]
    Both work great!
    Thanks for the response and help Mike and Jrv!
    Thanks for your help! SdeDot
    Cheers, you're very welcome.
    Don't retire TechNet! -
    (Don't give up yet - 13,225+ strong and growing)

  • Enumerate the users that have access to a particular directory

    Hi, my name is Jennifer and I have been searching for an answer to my problem through several blogs. The problem is that I have a Directory of which I want to not only retrieve the users\groups that have access to it but also enumerate through the groups
    to list actual users. The groups part is the main issue here. If I use get-acl, I can return any number of particular Active Directory groups that have access, however, I need to list the users inside this group and get-acl will not output an object I can
    work with. I thought I could do something like this (which I may have seen on this forum before):
    get-acl "C:\NestedGroupTest" | %{$_.access} \ ft -property identityreference
    This will return the groups\users that have access. Example:
    Domain\OU
    NT Authority\system
    Builtin\users
    ETC...
    I have tried exporting this output to a file and then trying to use get-adgroupmember (which obviously will not work on the non-AD groups) but the objects are of the wrong type so basically nothing in the Active Directory module will work...
    This seems like such a simple issue but it is causing me grief to no end...please help

    I can't guarantee that this will work in all cases, but it seems to work on my test domain. Warning: it's very slow and inefficient. It requires
    this module (get the 3.0 test version), but you can modify the foreach block's code somewhat to get it to work with Get-Acl. 
    Get-Item C:\NestedGroupTest | Get-AccessControlEntry | ForEach-Object { $PropertyNames = $null }{
    if (-not $PropertyNames) {
    # We need to copy the property. This will get a list
    # of the properties on each ACE when it encounters
    # the first ACE (since the rest of this is so ineffecient,
    # we can feel good that we saved some work by doing this)
    $PropertyNames = $_ | Get-Member -MemberType Properties | select -exp Name
    # Create a new hashtable that will be used to create a PSObject
    $NewObjectProps = @{}
    foreach ($CurrentProperty in $PropertyNames) {
    $NewObjectProps.$CurrentProperty = $_.$CurrentProperty
    # Check to see if this SID belongs to an AD group
    Write-Verbose ("Current principal: {0}" -f $_.Principal)
    try {
    $Group = Get-ADGroup -Filter { SID -eq $_.SecurityIdentifier } -ErrorAction Stop
    catch {
    # Write a warning or something?
    if ($Group) {
    Write-Verbose " -> Group, so looking up members"
    $Users = $Group | Get-ADGroupMember -Recursive | select @{N="Principal"; E={$_.SID.Translate([System.Security.Principal.NTAccount])}}, @{N="SecurityIdentifier"; E={$_.SID}}
    else {
    Write-Verbose " -> Not an AD group"
    $Users = $_ | select Principal, SecurityIdentifier
    # Go through each user/non-translated group, modify two
    # hashtable properties, and create the new PSObject
    $Users | ForEach-Object {
    $NewObjectProps.SecurityIdentifier = $_.SecurityIdentifier
    $NewObjectProps.Principal = $_.Principal
    $NewObject = New-Object PSObject -Property $NewObjectProps
    # This will make the new object show the module's custom formatting:
    $NewObject.pstypenames.Insert(0, "PowerShellAccessControl.Types.AdaptedAce")
    $NewObject
    That should resemble the output that Get-AccessControlEntry would give you, but AD groups have been translated to users. If you pipe that to Export-CSV, you'd have plenty of information for each ACE, including the path, principal, security identifier, access
    mask, etc. You could also pipe that to Select-Object and just ask for certain properties (try it with these properties: Path, Principal, AccessMask, AccessMaskDisplay, AppliesTo).
    You can also use the Get-AccessControlEntry function's parameters to do some filtering on the ACEs that are returned (maybe you only want ACEs with FullControl, or ACEs that were not inherited...)
    Give it a shot and let me know if it works for you. If you need more explanation of what's going on in the foreach-object process block, let me know and I'll try to help. It can be modified to work with version 2.1 of my module, and with Get-Acl.

  • How to truncate the Dimensions: ORA-02266

    I simply want to truncate the dimensions of star schema.
    First I truncate the fact table with Sql, that works.
    Then truncating a dimension fails with this error:
    Truncate table fcDwh.DIM_DEPS
    Error report:
    SQL Error: ORA-02266: unique/primary keys in table referenced by enabled foreign keys
    02266. 00000 - "unique/primary keys in table referenced by enabled foreign keys"
    *Cause:    An attempt was made to truncate a table with unique or
    primary keys referenced by foreign keys enabled in another table.
    Other operations not allowed are dropping/truncating a partition of a
    partitioned table or an ALTER TABLE EXCHANGE PARTITION.
    *Action:   Before performing the above operations the table, disable the
    foreign key constraints in other tables. You can see what
    constraints are referencing a table by issuing the following
    command:
    SELECT * FROM USER_CONSTRAINTS WHERE TABLE_NAME = "tabnam";
    If the fact table is already empty, I don't violate any foreign key constraint.
    Or am I wrong with this?
    The constraints below:
    OWNER CONSTRAINT_NAME CONSTRAINT_TYPE TABLE_NAME SEARCH_CONDITION R_OWNER R_CONSTRAINT_NAME DELETE_RULE STATUS DEFERRABLE DEFERRED VALIDATED GENERATED BAD RELY LAST_CHANGE INDEX_OWNER INDEX_NAME INVALID VIEW_RELATED
    FCDWH SYS_C0019008 C DIM_DEPS "DIMENSION_KEY" IS NOT NULL ENABLED NOT DEFERRABLE IMMEDIATE VALIDATED GENERATED NAME 07-SEP-07
    FCDWH DIM_DEPS_DIMENSION_KEY_PK P DIM_DEPS ENABLED NOT DEFERRABLE IMMEDIATE VALIDATED USER NAME 07-SEP-07 FCDWH DIM_DEPS_DIMENSION_KEY_PK

    Try using NumberFormat class:
    NumberFormat currency = NumberFormat.getNumberInstance();
    currency.setMinimumFractionDigits(2);
    currency.setMaximumFractionDigits(2);
    String s = currency.format(anyFloatValue);
    ..

Maybe you are looking for

  • Migrate web application to JDeveloper 10.1.3

    Hi, I am migrating a web application from JDeveloper 9.0.5.2 to JDeveloper 10.1.3. I hav got error message: java.lang.NullPointerException      at oracle.jdeveloper.offlinedb.migration.OfflineDBProjectMigrator.loadAllObjects(OfflineDBProjectMigrator.

  • Object ID for PO long text for BDC of material master

    Hi all, we are working on BDC of material master:    I have given some technical specifications in the P O text view of Material Master, i want to assign an object id for this long text , how to assign an object id for the long text? regards, urendra

  • Pages 5 hyperlinks why has it gone? What alternatives now?

    I often used the hyperlink in Pages. It was a truly sensible, applesque! and simple method to creat hyperlinks direct to sites for my students and for use in teaching and writing articles. My old 'Pages' still has them and I forgot about the links on

  • Converting time stamp in waveform to seconds

    Hello, I would like to convert the time stamp in a waveform (coming from 'AI Sample Channel') into seconds.  Currently when I read the waveform into a file I get a format that looks like 18:00:47.453000 Any help you can offer would be greatly appreci

  • How to call a class from a method ?

    Hi, I have a Connection class and another class called 'B' class. class Connection { public static void main (String args[]) { try{ Class.forName("...jdbcDriver...); String url="jdbc:...//localhost:.../DBName"; Connection con=DriverManager.getConnect