Self-referencing relationship line is non-movable

I am using Version 3.0.0.665 of data modeler. When I create a self-referencing relationship, the relationship line ends cannot be moved. They seem to be fixed. Is this the normal behavior. Any way to make them more flexible.

You can't adjust the size of self referencing lines at the stage. We do have this logged to fix in a future release.
Sue

Similar Messages

  • EF6 Code First: Many to Many Self referencing relationship

    Hi,
    Could any one show me an example for many to many self referencing?
    The scenario is that I have a user table that will contains collection of users as friends.
    Thanks,
    Bo

    Hi Kalman,
    Really appreciate your answer.
    I just wonder if I can, alternatively, set up tables as below,
    Public class user
    public int userId{get; set;}
        public
    virtual
    ICollection<User> CircleOneFriends { get; set; }
        public virtual ICollection<User>
    CircleTwoFriends { get; set; }
       public User()
    CircleOneFriends
    = new HashSet<User>();
    CircleTwoFriends = new HashSet<User>();
    public class UserConfiguration : EntityTypeConfiguration<User>
        public
    UserConfiguration()
           this.HasMany(x=>x.CircleOneFriends) .WithMany(x=>x.CircleTwoFriends).Map(x=>x.ToTable("Friends"))
    Do you think that will work in my case?
    Thanks a lot,
    Bo

  • Self referencing table many to many relationship

    I am in a bit of a logic pickle, and I was wondering if someone could help me out.
    I have a table in a database I am designing called document, it holds information on surprisingly on documents in our DMS.
    I want to create the notion that a document can have multiple related documents, and those documents can be the related documents for many documents.
    So it is a self referencing table, I have done these before so no big deal, but this time is a many to many relation, it wasnt before.
    Maybe something like:
    document
    docid (pk)
    related_doc
    docid (pk) (fk to document.docid)
    related_docid (pk) fk to document.docid)
    Does anyone have any experience with this or any advise I might find sueful?
    Thanks!

    A junction table can be used to resolve a many-to-many relationship as is in your example. There are two PK/FK relationships between document and related_document table. This will prevent denormalization of data.
    The other option could be to have just one table with two columns (parent_doc_id and child_doc_id) and have a PK constraint on both the columns - just like bill-of-materials.
    But I think the approach you have in your posting will work well.
    Shakti
    http://www.impact-sol.com
    Developers of Guggi Oracle - Tool for DBAs and Developers

  • Self referencing table and contraint

    Hi,
    I have a self referencing table, used to store information on projects in an organization. There is a pimary key (modifier) and a foreign key to the modifier field (parentModifier)
    Note: (modifier = project in the organization)
    Basically, the parentModifier cannot be equal to the modifier in the same table, or equal to any of its children, otehrwise you get wierd recursive relationships. Its like saying you cannot be your own father, or one of your children cannot be your father. To get a list of the modifiers the parentModifier cannot be, the following statement can be used:
    select
    modifier
    from
    modifier
    where
    modifier = 'A'
    and
    level >= 1
    connect by prior
    modifier = parentModifier
    start with
    modifier = 'A'
    order by
    level;
    So, now, I guess the way to do this is perform that query in a trigger before each row is being updated, so the pseudo code would be something like:
    BEFORE UPDATE ON modifier
    FOR EACH ROW
    DECLARE
    modifierToChange varchar2(255);
    modifierList ???;
    BEGIN
    select
    modifier
    into
    modifierList
    from
    modifier
    where
    modifier = 'A'
    and
    level >= 1
    connect by prior
    modifier = parentModifier
    start with
    modifier = 'A'
    order by
    level;
    if modifierToChange in modifierList
    return error
    else
    execute query
    end if
    END
    As you can see my PL/SQL is limitied. At the moment I can handle this at the application layer (in php), but if the admin going to SQL Plus and starts to fiddle, they can easy break the system, by setting an invalid relationship.
    I was wondeirng, if anyone could give me some help or advice, it would be fantastic,
    Thanks!

    Having a unique key on mod_id would be enough to make sure the same element is not in the structure more than once. By allowing it to happed you will have all the descendants of the dup element following it when you walk the tree.
    Let's say this is the intended behavior.
    Consider the following test scenario:
    create table modifier (
      mod_id varchar2(10),
      parent_mod_id varchar2(10)
    insert into modifier (mod_id, parent_mod_id) values ('a', null);
    insert into modifier (mod_id, parent_mod_id) values ('aa', 'a');
    insert into modifier (mod_id, parent_mod_id) values ('ab', 'a');
    insert into modifier (mod_id, parent_mod_id) values ('ac', 'a');
    insert into modifier (mod_id, parent_mod_id) values ('aaa', 'aa');
    insert into modifier (mod_id, parent_mod_id) values ('aab', 'aa');
    insert into modifier (mod_id, parent_mod_id) values ('aac', 'aa');
    insert into modifier (mod_id, parent_mod_id) values ('aba', 'ab');
    insert into modifier (mod_id, parent_mod_id) values ('abb', 'ab');
    insert into modifier (mod_id, parent_mod_id) values ('abc', 'ab');
    insert into modifier (mod_id, parent_mod_id) values ('aca', 'ac');
    insert into modifier (mod_id, parent_mod_id) values ('acb', 'ac');
    insert into modifier (mod_id, parent_mod_id) values ('acc', 'ac');
    insert into modifier (mod_id, parent_mod_id) values ('b', null);
    insert into modifier (mod_id, parent_mod_id) values ('ba', 'b');
    insert into modifier (mod_id, parent_mod_id) values ('bb', 'b');
    insert into modifier (mod_id, parent_mod_id) values ('bc', 'b');
    insert into modifier (mod_id, parent_mod_id) values ('baa', 'ba');
    insert into modifier (mod_id, parent_mod_id) values ('bab', 'ba');
    insert into modifier (mod_id, parent_mod_id) values ('bac', 'ba');
    insert into modifier (mod_id, parent_mod_id) values ('bba', 'bb');
    insert into modifier (mod_id, parent_mod_id) values ('bbb', 'bb');
    insert into modifier (mod_id, parent_mod_id) values ('bbc', 'bb');
    insert into modifier (mod_id, parent_mod_id) values ('bca', 'bc');
    insert into modifier (mod_id, parent_mod_id) values ('bcb', 'bc');
    insert into modifier (mod_id, parent_mod_id) values ('bcc', 'bc');
    commit;
    SQL> select lpad(' ', 2 * (level - 1)) || mod_id item
      2    from modifier
      3   start with parent_mod_id is null
      4  connect by prior mod_id = parent_mod_id;
    ITEM
    a
      aa
        aaa
        aab
        aac
      ab
        aba
        abb
        abc
      ac
        aca
        acb
        acc
    b
      ba
        baa
        bab
        bac
      bb
        bba
        bbb
        bbc
      bc
        bca
        bcb
        bcc
    26 rows selected
    Create a function to verify if a mod_id already is parent_mod_id's ascendant or descendant:
    create or replace function exists_in_parents_branch
      i_mod_id in varchar2
    ,i_parent_mod_id in varchar2
    ) return boolean is
      pragma autonomous_transaction;
      v_dummy varchar2(10);
    begin
      select mod_id
        into v_dummy
        from (select mod_id
                from modifier
               where mod_id = i_mod_id
              connect by prior mod_id = parent_mod_id
               start with mod_id = i_parent_mod_id
              union
              select mod_id
                from modifier
               where mod_id = i_mod_id
              connect by prior parent_mod_id = mod_id
               start with mod_id = i_parent_mod_id);
      return true;
    exception
      when no_data_found then
        return false;
    end exists_in_parents_branch;
    Create a trigger that calls the function above for every insert and update
    create or replace trigger biu_modifier
    before insert or update on modifier
    for each row
    begin
      if exists_in_parents_branch(:new.mod_id, :new.parent_mod_id) then
        raise_application_error(-20000, 'Cannot insert or update because of recursive relationship.');
      end if;
    end biu_modifier;
    You are all set.
    Here is a statement that should fail:
    SQL> insert into modifier (mod_id, parent_mod_id) values ('bcc', 'b');
    insert into modifier (mod_id, parent_mod_id) values ('bcc', 'b')
    ERROR at line 1:
    ORA-20000: Cannot insert or update because of recursive relationship.
    ORA-06512: at "RC.BIU_MODIFIER", line 3
    ORA-04088: error during execution of trigger 'RC.BIU_MODIFIER'
    Here is a statement that should succeed:
    SQL> insert into modifier (mod_id, parent_mod_id) values ('aaaa','aaa');
    1 row created.

  • Need help on self referencing a ssrs report

    Hi All,
    I have a graph on one of my report which shows data on level 1 by default and go on showing level 2 and level 3 data on successive clicks. This has been achieved by self referencing a ssrs report and passing respective parameters. Now to identify which level
    data needs to be shown on graph, I have used one more parameter which default value is 1 and go on increasing to 2 then 3 on successive click and this parameter value is used in group expression of graph. This works just fine.
    But the real problem has occurred when you go and select report parameters which are corresponding to level 1, level 2 and level 2 values and click on apply in between. For e.g. Assume level 1=Region, level 2=SubRegion and level 3=Country. When you run this
    report it shows region wise data on graph and value of fourth parameter is 1, now when you click on graph it takes you to level 2 i.e. it shows sub region wise data on graph and value of fourth parameter is 2 but when you go and select all region, sub region
    and countries from report parameters and click on apply button then it should show data on graph region wise but since the time you were selecting parameter data was sub region wise and value of fourth parameter was 2 it shows data for all sub regions which
    is weird and not acceptable at all. 
    I am hoping SSRS should provide a way to pass parameters just like we pass in action on any control within ssrs report to solve this issue. Please help me out to solve this issue or let me know if need more infor.

    Hi,
    There was an error reading from the pipe: Unrecognized error 109 (0x6d).
    One reason was inconsistent binding between client and server <netNamedPipeBinding> <security mode="None"></security>... (no
    communication)
    The other intermittent issue was time-out related.
    For more information, you could refer to:
    http://stackoverflow.com/questions/15836199/wcf-namedpipe-communicationexception-the-pipe-has-been-ended-109-0x6d
    http://stackoverflow.com/questions/22334514/wcf-named-pipe-error-the-pipe-has-been-ended-109-0x6d
    Regards

  • ORA-02291 during MERGE on self-referenced table

    Hello,
    I encountered error ORA-02291 when I tried to use MERGE statement on the table with "self-referenced" foreign key. Using the foreign key deferrable did not help. The only one thing, which helped me, was using errorlog table. See the demonstration:
    Working as common user:
    SQL> CONNECT scott/tiger
    First of all, I create table and (not deferrable) constraints:
    CREATE TABLE fkv (
         id NUMBER(1) CONSTRAINT nn_fkv_id NOT NULL,
         parent_id NUMBER(1) CONSTRAINT nn_fkv_paid NOT NULL
    ALTER TABLE fkv ADD CONSTRAINT pk_fkv_id PRIMARY KEY (id);
    ALTER TABLE fkv ADD CONSTRAINT fk_fkv_paid FOREIGN KEY (parent_id) REFERENCES fkv(ID) NOT DEFERRABLE;
    INSERT is working well:
    INSERT INTO fkv (
         id,
         parent_id
    SELECT
    1,
    1
    FROM
    DUAL;
    COMMIT;
    1 rows inserted.
    commited.
    MERGE statement using UPDATE branch is working well too:
    MERGE INTO fkv USING (
    SELECT
    1 AS ID,
    1 AS PARENT_ID
    FROM
    DUAL
    ) a
    ON (
    fkv.id = a.id
    WHEN MATCHED THEN
    UPDATE SET
    fkv.parent_id = a.parent_id
    WHERE
    A.ID IS NOT NULL
    DELETE WHERE a.id IS NULL
    WHEN NOT MATCHED THEN
    INSERT (
    ID,
    parent_id
    VALUES (
    A.ID,
    A.PARENT_ID);
    COMMIT;                                        
    1 rows merged.
    commited.
    And now is coming the strange behaviour:
    MERGE INTO fkv USING (
    SELECT
    2 AS id,
    2 AS PARENT_ID
    FROM
    DUAL
    ) a
    ON (
    fkv.id = a.id
    WHEN MATCHED THEN
    UPDATE SET
    fkv.parent_id = a.parent_id
    WHERE
    A.ID IS NOT NULL
    DELETE WHERE a.id IS NULL
    WHEN NOT MATCHED THEN
    INSERT (
    ID,
    parent_id
    VALUES (
    A.ID,
    A.PARENT_ID);
    SQL Error: ORA-02291: integrity constraint (SCOTT.FK_FKV_PAID) violated - parent key not found
    ROLLBACK;
    rollback complete.
    Ok, even it is not a good solution, I try deferrable constraint:
    ALTER TABLE fkv DROP CONSTRAINT fk_fkv_paid;
    ALTER TABLE fkv ADD CONSTRAINT fk_fkv_paid FOREIGN KEY (parent_id) REFERENCES fkv(id) DEFERRABLE INITIALLY DEFERRED;
    table FKV altered.
    table FKV altered.
    MERGE INTO fkv USING (
    SELECT
    2 AS id,
    2 AS PARENT_ID
    FROM
    DUAL
    ) a
    ON (
    fkv.id = a.id
    WHEN MATCHED THEN
    UPDATE SET
    fkv.parent_id = a.parent_id
    WHERE
    A.ID IS NOT NULL
    DELETE WHERE a.id IS NULL
    WHEN NOT MATCHED THEN
    INSERT (
    ID,
    parent_id
    VALUES (
    A.ID,
    A.PARENT_ID);
    1 rows merged.
    COMMIT;
    SQL Error: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (SCOTT.FK_FKV_PAID) violated - parent key not found
    ... deffered constraint did not help :-(
    Let's try another way - errorlog table; for the first with the not deferrable constraint again:
    ALTER TABLE fkv DROP CONSTRAINT fk_fkv_paid;
    ALTER TABLE fkv ADD CONSTRAINT fk_fkv_paid FOREIGN KEY (parent_id) REFERENCES fkv(ID) NOT DEFERRABLE;
    table FKV altered.
    table FKV altered.
    BEGIN
    sys.dbms_errlog.create_error_log (
    dml_table_name => 'FKV',
    err_log_table_name => 'ERR$_FKV'
    END;
    anonymous block completed
    Toys are prepared, let's start with error logging:
    MERGE INTO fkv USING (
    SELECT
    2 AS id,
    2 AS PARENT_ID
    FROM
    DUAL
    ) a
    ON (
    fkv.id = a.id
    WHEN MATCHED THEN
    UPDATE SET
    fkv.parent_id = a.parent_id
    WHERE
    A.ID IS NOT NULL
    DELETE WHERE a.id IS NULL
    WHEN NOT MATCHED THEN
    INSERT (
    ID,
    parent_id
    VALUES (
    A.ID,
    A.PARENT_ID)
    LOG ERRORS INTO err$_fkv;
    1 rows merged.
    Cannot belive, running SELECT for confirmation:
    SELECT * FROM err$_fkv;                    
    SELECT * FROM fkv;
    no rows selected
    ID PARENT_ID
    1 1
    2 2
    Ok, COMMIT:
    COMMIT;
    commited.
    SELECT for confirmation again:
    SELECT * FROM err$_fkv;                    
    SELECT * FROM fkv;
    no rows selected
    ID PARENT_ID
    1 1
    2 2
    Using deffered constraint and error logging is working well too.
    Metalink and Google did not help me. I am using databases 10.2.0.5 and 11.2.0.3.
    Has somebody encountered this problem too or have I missed something?
    Thank you
    D.

    drop table fkv;
    CREATE TABLE fkv (
    id NUMBER(1) CONSTRAINT nn_fkv_id NOT NULL,
    parent_id NUMBER(1) CONSTRAINT nn_fkv_paid NOT NULL
    CREATE INDEX PK_FKV_ID ON FKV(ID);
    ALTER TABLE fkv ADD CONSTRAINT pk_fkv_id PRIMARY KEY (id);
    ALTER TABLE FKV ADD CONSTRAINT FK_FKV_PAID FOREIGN KEY (PARENT_ID) REFERENCES FKV(ID);Now run your MERGE statement and it works with non deferrable constraints.
    Personally, I would contact support about this before depending on it in production.
    P.S. I was not able to reproduce your findings that dropping and re-adding the constraints changes things. I suspect that when you dropped the constraint the index was NOT dropped, so you kept a non-unique index.
    Try again using ALTER TABLE FKV DROP CONSTRAINT PK_FKV_ID drop index;

  • EJB-QL with self referencing cmr-field in path identifier fails

    I have a simple application . Only one bean and one relationship. The relationship is a (0..1)-(0..1) for the same bean (self referencing).
    I have a finder method defined with ejb-ql that tries to access the field of one of the cmr fields of the relationship.
    class1Bean is the abstract schema for my bean, and subclass1 is the cmr-field name.
    SELECT OBJECT(obj) FROM class1Bean obj WHERE obj.subclass1.id LIKE ?1
    Here is the error message when trying to deploy:
    Bean: Class1
    Method: java.util.Collection findBySubclass1(java.lang.String)
    EJBQL: SELECT OBJECT(obj) FROM class1Bean obj WHERE obj.subclass1.id LIKE ?1
    Error: JDO75100: Fatal internal error: JDO75341: Missing field meta data for field 'subclass1' of 'Class1'
    This same code deploys fine on JBoss 4.0, and should be legal ejb-ql. Is this a known issue with Sun JSAS?

    Sounds like a problem with the bean metadata. Please check the entity mapping defined in sun-cmp-mappings.xml. Also make sure field sublass1 is defined as CMR everywhere.
    -- markus.

  • Multiple referenced relationships over the same intermediate dimension - generated processing query

    Hi, I know the title is a bit confusing so let me try to explain it:
    I have added 3 new dimensions do the AdventureWorks cube - RefA, RefB and RefC:
    They are all related to the DimReseller table, and finally, to the FactResellerSales table. In the dimension usage chart, you can see that there are 4 referenced relationships using the Reseller dimension as the intermediate dimension. The Geography
    was the existing one, and the other 3 were added.
    Now, if I process a partition from the Reseller Sales measure group, the Profiler catches this generated query on the server:
    SELECT [dbo_FactResellerSales].[dbo_FactResellerSalesSalesAmount0_0] AS [dbo_FactResellerSalesSalesAmount0_0]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesOrderQuantity0_1] AS [dbo_FactResellerSalesOrderQuantity0_1]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesExtendedAmount0_2] AS [dbo_FactResellerSalesExtendedAmount0_2]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesTaxAmt0_3] AS [dbo_FactResellerSalesTaxAmt0_3]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesFreight0_4] AS [dbo_FactResellerSalesFreight0_4]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesDiscountAmount0_5] AS [dbo_FactResellerSalesDiscountAmount0_5]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesUnitPrice0_6] AS [dbo_FactResellerSalesUnitPrice0_6]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesUnitPriceDiscountPct0_7] AS [dbo_FactResellerSalesUnitPriceDiscountPct0_7]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesTotalProductCost0_8] AS [dbo_FactResellerSalesTotalProductCost0_8]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesProductStandardCost0_9] AS [dbo_FactResellerSalesProductStandardCost0_9]
    ,[dbo_FactResellerSales].[dbo_FactResellerSales0_10] AS [dbo_FactResellerSales0_10]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesEmployeeKey0_11] AS [dbo_FactResellerSalesEmployeeKey0_11]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesPromotionKey0_12] AS [dbo_FactResellerSalesPromotionKey0_12]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesSalesTerritoryKey0_13] AS [dbo_FactResellerSalesSalesTerritoryKey0_13]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesResellerKey0_14] AS [dbo_FactResellerSalesResellerKey0_14]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesProductKey0_15] AS [dbo_FactResellerSalesProductKey0_15]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesCurrencyKey0_16] AS [dbo_FactResellerSalesCurrencyKey0_16]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesOrderDateKey0_17] AS [dbo_FactResellerSalesOrderDateKey0_17]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesShipDateKey0_18] AS [dbo_FactResellerSalesShipDateKey0_18]
    ,[dbo_FactResellerSales].[dbo_FactResellerSalesDueDateKey0_19] AS [dbo_FactResellerSalesDueDateKey0_19]
    ,[dbo_DimReseller_6].[GeographyKey] AS [dbo_DimResellerGeographyKey5_0] -- 1
    ,[dbo_DimReseller_22].[RefAKey] AS [dbo_DimResellerRefAKey7_0] -- 2
    ,[dbo_DimReseller_23].[RefBKey] AS [dbo_DimResellerRefBKey9_0] -- 3
    ,[dbo_DimReseller_24].[RefCKey] AS [dbo_DimResellerRefCKey11_0] -- 4
    FROM (
    SELECT [SalesAmount] AS [dbo_FactResellerSalesSalesAmount0_0]
    ,[OrderQuantity] AS [dbo_FactResellerSalesOrderQuantity0_1]
    ,[ExtendedAmount] AS [dbo_FactResellerSalesExtendedAmount0_2]
    ,[TaxAmt] AS [dbo_FactResellerSalesTaxAmt0_3]
    ,[Freight] AS [dbo_FactResellerSalesFreight0_4]
    ,[DiscountAmount] AS [dbo_FactResellerSalesDiscountAmount0_5]
    ,[UnitPrice] AS [dbo_FactResellerSalesUnitPrice0_6]
    ,[UnitPriceDiscountPct] AS [dbo_FactResellerSalesUnitPriceDiscountPct0_7]
    ,[TotalProductCost] AS [dbo_FactResellerSalesTotalProductCost0_8]
    ,[ProductStandardCost] AS [dbo_FactResellerSalesProductStandardCost0_9]
    ,1 AS [dbo_FactResellerSales0_10]
    ,[EmployeeKey] AS [dbo_FactResellerSalesEmployeeKey0_11]
    ,[PromotionKey] AS [dbo_FactResellerSalesPromotionKey0_12]
    ,[SalesTerritoryKey] AS [dbo_FactResellerSalesSalesTerritoryKey0_13]
    ,[ResellerKey] AS [dbo_FactResellerSalesResellerKey0_14]
    ,[ProductKey] AS [dbo_FactResellerSalesProductKey0_15]
    ,[CurrencyKey] AS [dbo_FactResellerSalesCurrencyKey0_16]
    ,[OrderDateKey] AS [dbo_FactResellerSalesOrderDateKey0_17]
    ,[ShipDateKey] AS [dbo_FactResellerSalesShipDateKey0_18]
    ,[DueDateKey] AS [dbo_FactResellerSalesDueDateKey0_19]
    FROM (
    SELECT [dbo].[FactResellerSales].[ProductKey]
    ,[dbo].[FactResellerSales].[OrderDateKey]
    ,[dbo].[FactResellerSales].[DueDateKey]
    ,[dbo].[FactResellerSales].[ShipDateKey]
    ,[dbo].[FactResellerSales].[ResellerKey]
    ,[dbo].[FactResellerSales].[EmployeeKey]
    ,[dbo].[FactResellerSales].[PromotionKey]
    ,[dbo].[FactResellerSales].[CurrencyKey]
    ,[dbo].[FactResellerSales].[SalesTerritoryKey]
    ,[dbo].[FactResellerSales].[SalesOrderNumber]
    ,[dbo].[FactResellerSales].[SalesOrderLineNumber]
    ,[dbo].[FactResellerSales].[RevisionNumber]
    ,[dbo].[FactResellerSales].[OrderQuantity]
    ,[dbo].[FactResellerSales].[UnitPrice]
    ,[dbo].[FactResellerSales].[ExtendedAmount]
    ,[dbo].[FactResellerSales].[UnitPriceDiscountPct]
    ,[dbo].[FactResellerSales].[DiscountAmount]
    ,[dbo].[FactResellerSales].[ProductStandardCost]
    ,[dbo].[FactResellerSales].[TotalProductCost]
    ,[dbo].[FactResellerSales].[SalesAmount]
    ,[dbo].[FactResellerSales].[TaxAmt]
    ,[dbo].[FactResellerSales].[Freight]
    ,[dbo].[FactResellerSales].[CarrierTrackingNumber]
    ,[dbo].[FactResellerSales].[CustomerPONumber]
    FROM [dbo].[FactResellerSales]
    WHERE OrderDateKey >= '20080101'
    AND OrderDateKey <= '20081231'
    ) AS [FactResellerSales]
    ) AS [dbo_FactResellerSales]
    /*** One JOIN per Referenced Relationship ***/
    ,[dbo].[DimReseller] AS [dbo_DimReseller_6] -- 1
    ,[dbo].[DimReseller] AS [dbo_DimReseller_22] -- 2
    ,[dbo].[DimReseller] AS [dbo_DimReseller_23] -- 3
    ,[dbo].[DimReseller] AS [dbo_DimReseller_24] -- 4
    WHERE (
    ([dbo_FactResellerSales].[dbo_FactResellerSalesResellerKey0_14] = [dbo_DimReseller_6].[ResellerKey]) -- 1
    AND ([dbo_FactResellerSales].[dbo_FactResellerSalesResellerKey0_14] = [dbo_DimReseller_22].[ResellerKey]) -- 2
    AND ([dbo_FactResellerSales].[dbo_FactResellerSalesResellerKey0_14] = [dbo_DimReseller_23].[ResellerKey]) -- 3
    AND ([dbo_FactResellerSales].[dbo_FactResellerSalesResellerKey0_14] = [dbo_DimReseller_24].[ResellerKey]) -- 4
    As you can see in the comments, the generated query contains 1 join on the referenced table
    per referenced relationship. This can slow down the processing if both the Fact table and the Referenced Dimension table are big (and they usually are, otherwise the design would be different). The thing is, all 4 tables are filtered in the
    WHERE clause on the same condition, which makes perfect sense. This leads to the conclusion that all 4 columns could have been read from a single join.
    I was quite surprised by this kind of query generation and I can't seem to find a reason why this would be so, or how it could be avoided. Naturally, the RefAKey, RefBKey, RefCKey columns could be added to the Fact table, eliminating the need for referenced
    relationships, but this would add 3*4 bytes per row to the Fact table. The Fact table in my real example contains around 3 billion rows, so adding extra bytes is painful. (Yes, it's partitioned but still ... )
    The referenced relationships could also be "dematerialized" by removing the famous Materialize check in the relationship settings. Then again, this would issue a join to the referenced tables at query time, slowing down the query.
    Has anyone been profiling processing queries like this one and stopped to think about it?

    I don't believe it's on the Essbase side, as it uses a fairly standard API to allow string input to such things, and it's limitation is well beyond 512 chars even for a direct formula input.<BR><BR>I instead suspect that a carriage return/line feed is being inserted by the ODBC driver as part of it's output formatting, and this is causing the API to consider the input record "completed." I could be wrong, of course, but if you examine the Memo field closely, you may find the formatting to have migrated to the Access database, and even if not, you are still using ODBC to access it on the output side, so we're back to the same issue.<BR><BR>Perhaps it really is an issue related to the ODBC drivers in Essbase, but it's not unique to dim build, to formulas, or Essbase for that matter. Allowing a single field to <i>output</i> more than 512 chars in a single field is where I believe you will find the real issue.<BR><BR>Again, we need an ODBC expert to weigh in on this. <img src="i/expressions/face-icon-small-smile.gif" border="0"><BR>

  • Self Referencing Tables...

    I have a self-referencing table (a Topic can be a response to another Topic) and read one of Frank Nimphius' blogs on this subject, posted on the ADF board for advise. As a result I created the read-only ViewObject to set up this tree relationship and set it to be exposed to the App Module.
    Do I need to do more to it than that for JHeadstart to generate the right page defs? Any advise on setting this up cleanly? My user interface must present a page in which users can post new Topics, view topics in a heirarchy (response thread, like in this forum) and respond to Topics or responses. A response is a Topic that references another (parent) Topic. I have to believe this has been done before a million times but am not sure myself how to do it.
    Thanks!

    Steve,
    I've read the section and am getting this error:
    (oracle.jbo.SQLStmtException) JBO-27122: SQL error during statement preparation. Statement: SELECT Topic.SUBJECT, Topic.ROW_ID, Status.STATUS_CHOICE, Status.ROW_ID AS ROW_ID11, Topic.CREATED_BY, Topic.CREATION_DATE, Response.SUBJECT AS SUBJECT1, Response.CREATION_DATE AS CREATION_DATE1, Response.ROW_ID AS ROW_ID12, Response.CREATED_BY AS CREATED_BY1 FROM TOPIC Topic, RESPONSE Response, STATUS Status WHERE (Topic.ROW_ID = Response.MASTER_ID (+)) AND (Topic.TOPIC_STATUS_ID = Status.ROW_ID) CONNECT BY PRIOR Topic.ROW_ID = Response.MASTER_ID (+) OR Response.ROW_ID = Response.MASTER_ID (+) ORDER BY SUBJECT,CREATION_DATE1
    ----- LEVEL 1: DETAIL 0 -----
    (java.sql.SQLException) ORA-01436: CONNECT BY loop in user data
    I have a table called Topic with a Pk called ROW_ID and another table called Response with a Pk called ROW_ID and an Fk called MASTER_ID. A Topic can have many Responses and a Response can also have many Responses. The parent ID could point to either a Topic or a Response. There's no limit on how many levels this can continue. There's a Status table also from which I want to show the text value of the Status for the Topic row (not the Status ROW_ID)
    I have a View Object including entities: Topic, Response & Status
    I tried the SQL query as:
    (Topic.ROW_ID = Response.MASTER_ID (+)) AND (Topic.TOPIC_STATUS_ID = Status.ROW_ID) CONNECT BY PRIOR Topic.ROW_ID = Response.MASTER_ID (+) OR Response.ROW_ID = Response.MASTER_ID (+)
    Hoping to have this result:
    Topic A
    -Response A (to Topic A)
    --Response B (to A)
    ---Response C (to B)
    -Response D (to Topic A)
    Topic B
    Topic C
    What am I doing wrong?
    Is there a guide that explains better using JHeadstart with JDeveloper (rather than Oracle Designer, which we don't use)? The developer's guide for JHeadstart is hard to translate for use with JDeveloper...
    Thanks!!

  • JPA: How to initialise an entity for a self-referencing table?

    I am working on a project that requires a self-referencing table:
    mysql> show create table attributes\G
    *************************** 1. row ***************************
           Table: attributes
    Create Table: CREATE TABLE `attributes` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `parent` int(11) DEFAULT NULL,
      `type` int(11) DEFAULT NULL,
      `name` varchar(128) DEFAULT NULL,
      PRIMARY KEY (`id`),
      KEY `parent` (`parent`),
      KEY `type` (`type`),
      CONSTRAINT `attributes_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `attributes` (`id`),
      CONSTRAINT `attributes_ibfk_2` FOREIGN KEY (`type`) REFERENCES `attributes` (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=latin1
    I used NetBeans to generate an entity class from the table:
    @Entity
    @Table(name = "attributes")
    @XmlRootElement
    @NamedQueries({
        @NamedQuery(name = "Attributes.findAll", query = "SELECT a FROM Attributes a"),
        @NamedQuery(name = "Attributes.findById", query = "SELECT a FROM Attributes a WHERE a.id = :id"),
        @NamedQuery(name = "Attributes.findByName", query = "SELECT a FROM Attributes a WHERE a.name = :name")})
    public class Attributes implements Serializable {
        private static final long serialVersionUID = 1L;
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        @Basic(optional = false)
        @Column(name = "id")
        private Integer id;
        @Size(max = 128)
        @Column(name = "name")
        private String name;
        @OneToMany(mappedBy = "parent")
        private Collection<Attributes> attributesCollection;
        @JoinColumn(name = "parent", referencedColumnName = "id")
        @ManyToOne
        private Attributes parent;
        @OneToMany(mappedBy = "type")
        private Collection<Attributes> attributesCollection1;
        @JoinColumn(name = "type", referencedColumnName = "id")
        @ManyToOne
        private Attributes type;
        @OneToMany(cascade = CascadeType.ALL, mappedBy = "attributes")
        private Collection<ItemAttributes> itemAttributesCollection;
        @OneToMany(mappedBy = "ivalue")
        private Collection<ItemAttributes> itemAttributesCollection1;
    But how can I write a constructor for this entity? The auto-generated code gets around the issue by doing nothing; the constructor is empty. I can't help thinking that if I set the parent and type references to anything with new Attributes(), then it will recurse out of control. What else can/shall I do? I know how to rewrite it to not use the entity relations, but I'd prefer to make it work.

    Cymae wrote:
    I don't want to call the hash table creation method because from what i understand about interfaces the idea is that your main method doesnt know the table is actually a hash table...is that right?That's not exactly the idea. The idea to use the interface as the type instead of the implementation, is that your class probably doesn't need to know the full type. This makes it easy to change the implementation of the interface if needed. However, somebody at some point has to create the concrete object, a HashTable.
    Basically, an interface describes a behavior, and a class that implements an interface decides how to actually perform this behavior. It is obviously impossible to perform the behavior if you are not told how to perform it.
    Table table = new HashTable() is the correct way to do it. This means that if you ever need you Table implementation to change, the only thing you need to change in your whole class is this line. For example you might want Table table = new FileTable().

  • Query output help: Display self-referencing table

    Hello,
    I'm trying to display in a cfoutput a self-referencing table.
    I'll start by showing some of the data in the table.
    There are only 3 columns, pl_id (auto increment id pri-key),
    pl_name and pl_parent_id (it's 0 if it's a parent, otherwise it's
    the pl_id value for the parent).
    pl_id pl_name pl_parent_id
    1 Country 0
    2 Food 0
    3 US 1
    4 Japan 1
    5 Hamburger 2
    6 Idaho 3
    7 Florida 3
    8 Cheese 2
    What I'm trying to output is something like this:
    Country - US - Idaho (3 levels here) or
    Country - US - Florida (or if there are only 2 levels like
    the next line)
    Food - Cheese
    I've tried using a cfoutput with a cfloop as well as grouping
    but not having any luck. Could someone clear my clouded head on
    this one?
    thanks much,
    Joe
    ps. Adobe should really use a fixed width font for these
    forums, it's impossible to line up table info!

    JoeNH2k wrote:
    > It would be nice if it were that easy, I (of course)
    tried that. The sort order
    > of the query doesn't matter. The data is not sorted once
    the function runs. The
    > sort has to come after the select box is populated by
    the function. I need to
    > get the data at this point and sort it, probably somehow
    creating a structure
    > or array from this data and sorting that(?).
    >
    <cfset myArr = ArrayNew(1)>
    <cfloop query="qryGetAll">
    <cfset temp = ArrayAppend(myArr,
    "#getNameWithParent(pl_id)#")>
    </cfloop>
    <cfset ArraySort(myArr, "textnocase", "asc")>
    <cfset myList = ArrayToList(myArr, ",")>
    then loop through myList to populate your <select>...
    how about that?
    Azadi Saryev
    Sabai-dee.com
    Vientiane, Laos
    http://www.sabai-dee.com

  • Self referencing table and SQL statement

    In my database, I have a self-referencing table, the table itself is for projects, and it allows users to get a hierarchical view of the company.
    Here is the SQL (modifier is the term we use for project code, BBCI is the top project)
    SELECT
    modifier, modifierDescription, level
    FROM
    modifier
    WHERE
    level <= 2
    CONNECT BY PRIOR
    modifier = parentModifier
    START WITH modifier = 'BBCI'
    ORDER BY level
    That perticular query gets the first two levels in the structure. I use this information to produce a tree structure in a web app.
    But users have requested it would be good if in the tree structure is showed an + or - depending on whether there were anymore children under each parent, or better still the number of children under it, for example
    BBCI
    + BBCI_CHILD
    + BBCI_CHILD2
    - BBCI_CHILD3
    or
    BBCI
    + BBCI_CHILD (3 projects underneath)
    + BBCI_CHILD2 (2 projects underneath)
    - BBCI_CHILD3 (0 projects underneath)
    I am really stumped on this issue, and I am sure there is a way to do this in the web app, so for example do a query for each child node to see how many child nodes are underneath, but I figure it would be a lot tidier and faster if I could do it from a single SQL statement. Unfortunately I have tried to do this and am very much stuck.
    If you need more information please let me know
    Thanks!
    Jon

    You may be able to do this using analytical functions but it depends on the Oracle version you are using. It can also be done with standard SQL - you just need to count the number of child rows for each modifier/project first and supply that list as an in-line view:
    SELECT decode(modifier,'X',null,decode(child_rows,null,'-','+')),
    m.modifier,
    decode(modifier,'X',null,'('||nvl(cq.child_rows,0)||' projects underneath)')
    FROM modifier m,
    (select parentModifier,
         count(parentModifier) child_rows
    from modifier
    where parentModifier is not null
    group by parentModifier) cq
    WHERE m.modifier=cq.parentModifier(+)
    AND level <= 2
    CONNECT BY PRIOR
         m.modifier = m.parentModifier
    START WITH modifier = 'X'
    ORDER BY level, modifier;
    which gives you something like...
    D MODIFIER DECODE(MODIFIER,'X',NULL
    X
    - Y1 (0 projects underneath)
    + Y2 (2 projects underneath)
    + Y3 (3 projects underneath)
    The decode stuff is just to show you the result, you can format the output in your calling code. Just extend the columns to include everything you want, modifierDescription etc..
    Hope this helps.

  • Best practice: self referencing table

    Hallo,
    I want to load a self referencing table to my enterprise area in the dwh. I am not sure how to do this. What if a record references to another record which is inserted later in the same etl process? There is now way to sort, because it is possible that record a references to record b and record b references to record a. Disabling the fk constraint is not a good idea, because this doesn't prevent that invalid references will be loaded? I am thinking of building two mappings, one without the self referencing column and the other only with it, but that would cause approx. twice as much running time. Any other solutions?
    Regards,
    Torsten

    Mind sharing the solution? Would be interested to hear your solution (high level).
    Jean-Pierre

  • Just upgraded my iPad to IOS5 and when the download was completed, a window said that there was an error and it could not restore.  Now I have a black screen with the Apple logo and the circle lines.  None of the buttons respond. Help, please!!

    Just upgraded my iPad to IOS5 and when the download was completed, a window said that there was an error and it could not restore.  Now I have a black screen with the Apple logo and the circle lines.  None of the buttons respond. Help, please!!

    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. Maybe this will let the iPad reboot and then you may need to restore again but see if this helps to start the iPad first.

  • Problem with self referencing cells

    Hello there,
    I'd like to have two columns that are NULL, unless the other column has a value entered into it.
    This seems to create an infinite lookup loop of self referencing.
    Can anyone suggest a work around?
    Please see example
    http://public.iwork.com/document/?a=p175104233&d=self_reference.numbers

    If for instance you have
    cell B2 = IF(C2="","","Not Null")
    and
    cell C2 = IF(B2="","", "Not Null")
    then, yes, you have a circular reference
    It sounds like what you want is if you enter (by hand, overwriting the formula that is there) a value in B2 then the formula in C2 will result in a value (not null). If you, instead, enter a value in C2 then the formula in B2 will result in a value.
    Try this addition to the formula:
    B2=IFERROR(IF(C2="","","not null"),"")
    C2=IFERROR(IF(B2="","","not null"),"")
    In other words, wrap it all up in an IFERROR
    Message was edited by: Badunit

Maybe you are looking for

  • Add Listener to Unknown Number of JMenuItems

    How can I add an ActionListener to each JMenuItem by cycling through an unknown number of menu items? I have a program that prompts the user for a database, then creates a JMenu of table names based on whatever database the user selects. This means t

  • Characters "fl" or "fi" are not displayed in safari

    My html file contains words as  "fill" or "float". Safari (last version, with Yosemite) displays a dot instead of fi or of fl. Chrome browser or MFF display it without problem. And Safari did it too, I would say one or two years ago. You'll see the p

  • How do I uninstall Adobe X from one drive, reinstall on another drive?

    I have Adobe X on my C drive and need to free space on that drive.  I have an external hard drive (D drive).  So, I would like to uninstall Adobe X from the C drive and install it on the D drive.  How do I do that so i do not have to pay for that ins

  • CSS state sync questions

    I learned from cisco doc that the CSS stat are exchanged in real time. " For new flows, CSSs exchange flow states in real time over the ISC links. For existing flows, CSSs exchange flow states at boot-up time and at VIP redundancy failover. I" http:/

  • Changing Serial Number of Produced Item

    Hello, We are using SAP Business Once 2007A (8.00.180) SP:00 PL: 45 we have produced items, and have changed our method of issuing serial numbers. Can the serial number be changed?  Or, do we have to disassemble the unit, and produce again, using the