Query Builder - foreign key relationships not showing automatically

Is it standard functionality in APEX that foreign key to primary key relationships are not shown in Query Builder when choosing related tables? Do you always have to join FKs to PKs manually (i.e. using control click) whenever you create joins in queries? In Oracle forms and SQL Developer the foreign key constaints are always draw in automatically. Any reason why this is not part of APEX's query builder as well? It's such a hassel to have to put them in each time when the relationships could easily be read directly from the data dictionary constraints.
regards
Paul P

bump...

Similar Messages

  • SQL Developer Data Modeler not drawing foreign key relationships

    I'm having trouble with SQL Developer Data Modeler when I importa a DDL that has foreign keys. I export DDL files from SQL developer and choose various subsets of files. Sometimes Data Modeler will not recognize a foreign key if I include say a dozen files in the DDL file, but it will if I include just a few. Worse, even if the foreign key is recognized, sometimes it is not drawn in the Data Modeler and I have no way to make it be drawn. To be specific, I import a file containing the DDL for just two tables -- I see the foreign key! I import a file containing the DDL for a dozen tables including the two, I don't! Is there something I am not understanding about when Data Modeler will draw foreign keys or is the tool simply quite buggy?
    Much thanks!
    -ttamon

    Hi Philip,
    I believe I have isolated the problem. Apparently if a field is named "FOREIGN..." it interferes with the tool recognizing foreign keys. Try to import a DDL file containing the following text:
    CREATE TABLE "SAMPLE"."SAMPLE_ONE"
    (     "ID" VARCHAR2(255 CHAR) NOT NULL ENABLE,
         "VALUE" VARCHAR2(255 CHAR),
         PRIMARY KEY ("ID")
    TABLESPACE "SAMPLE_DATA" ;
    CREATE TABLE "SAMPLE"."SAMPLE_TWO"
    (     "ID" VARCHAR2(255 CHAR) NOT NULL ENABLE,
         "FOREIGN_NAME" VARCHAR2(255 CHAR),
         PRIMARY KEY ("ID")
    TABLESPACE "SAMPLE_DATA" ;
    CREATE TABLE "SAMPLE"."SAMPLE_THREE"
    (     "ID" VARCHAR2(255 CHAR) NOT NULL ENABLE,
         "VALUE" VARCHAR2(255 CHAR) NOT NULL ENABLE,
         "ALT_ID" VARCHAR2(255 CHAR),
         PRIMARY KEY ("ID")
    TABLESPACE "SAMPLE_DATA" ENABLE,
         CONSTRAINT "FK6DF8294F2288190D" FOREIGN KEY ("ALT_ID")
         REFERENCES "SAMPLE"."SAMPLE_ONE" ("ID") ENABLE
    TABLESPACE "SAMPLE_DATA" ;
    You will discover the foreign key is not recognized or drawn! Now, if you swap the location of the third table (put it up first) everything works fine. This is how I discovered the problem, various subsets would work, others would not. To confirm the problem is with the field named "FOREIGN_NAME" use the DDL as specified above but change the first letter in the word "FOREIGN" to something else, and it will recognize the foreign key. Looks like a bug to me (took me about 4 hours to isolate this!). I am using Oracle SQL Developer Data Modeler version 2.0.0 Build 584.
    -ttamon

  • Code generation - foreign key relationships

    I'm using the code/descriptor generation tab to generate classes from existing tables. It offers an option of choosing which relationships to generate, but seems to miss out some of the defined foreign key relationships in the database.
    I have three tables, CLIENTS, TXNS and REG
    The following constraints are defined in my database:
    TXN Primary Key: (TXN_ID)
    CLIENTS Primary Key :CLIENT_ID, TXN_ID)
    CLIENTS Foriegn KEy : TXN_ID references TXNS
    REG Primary Key: CLIENT_ID, TXN_ID
    REG Foreign Key: CLIENT_ID, TXN_ID references CLIENTS
    I select these three tables and choose generate classes and descriptors for selected tables. When the "Choose Relationships to generate" screen comes up, it only shows me the CLIENTS<-->TXNS relationship, but not the REG<-->CLIENTS relationship, even though the database foreign key constraints all look as though they've been defined in similar ways.
    thanks for any help.

    Hi Matt,
    I'm not surprised that you have an issue with this. One bugbear I have with Gateway is that for some reason the designers don't think any context beyond the immediate preceding navigation node is important. They don't support this within the same service,so it's hardly likley to work in a service reference.
    I may be wrong but I don't think GW is OData compliant in this respect. If I have the navigation path /blindservice/FromHereSet(1)/ToAPoints(22)/ToBPoints, it's rather restrictive to say I cannot see the initial key of '1' in the path when I am trying to resolve 'ToBPoints'. If that value - where I started - is key to the context, I have to know it.
    Currently the only way to access this context is to embed the 'key history' in the intermediate entities, i.e. /blindservice/FromHereSet(1)/ToAPoints(1,22)/ToBPoints. In my view that is corrupting the URl to suit the limitations of the SAP OData implementation. What's even more confusing/frustrating is that the technical request context appears to be able to store the stacked navigation keys but doesn't make use of this design. 
    I feel your pain
    Ron.

  • Problem with Foreign Key relationships in SAP R/3 4.7

    Hi Experts,
    I am trying to create a foreign key relationship between 2 transparent tables in SAP R/3 4.7
    Table 1:ZAAVNDR (MANDT (pk), VENDORNO (pk), NAME, REGION, COUNTRY (fk)) Foreign Key Table
    Table 2: ZAAVNDRREF(MANDT(pk), COUNTRY (pk)) ---Check table
    I have added few valid countries in check table but when I am adding some records in foreign key table with invalid countries these records are not being restricted and are still successfully going into the table.
    Could any one please help in this.
    Thanks in anticipation.
    -Amit

    Hi Sandra,
    Many thanks for your response and providing time of yours.
    Now, I have done exactly the same thing, but still it is the same.
    I have created two new tables as below:
    ZAAVREF (Check table)
    MANDT (PK)
    COUNTRY (PK) Domain:ZAACOUNT (CHAR 10)
    ZAAV1 (Foreign key table)
    MANDT (PK)
    COUNTRY (PK) Domain:ZAACOUNT (CHAR 10)
    Then I have created FK on country of foreign key table ZAAV1 and then SE16 (for table ZAAVREF)->Create Entries-> Entered values for Country only->Save....Records entered with valid Country values.
    After that SE16 (for table ZAAV1)->Create Entries-->Entered an Invalid country->Save->Still the record entered to the Database successfully....
    Could you please let me know where I am going wrong.
    I am using SAP R/3 4.7 and creating tables using Tools->ABAP Workbench->Development->ABAP dictionary

  • Maintenance View for custom table with foreign key relationship

    Hi Folks,
         I have created a custom table with foreign key relationship with other check tables. I want to create a maintenance view / tablemaintenance generator. What all things I need to take care for the foreign keys related fields while creating the maintenance view / tablemaintenance generator.
    Regards,
      santosh

    Hi,
    You do not have to do anything explicitely for the foreign key relationships in the table maintainance generator.
    Create the table maintainance generator via SE11 and it will take care of all teh foreign key checks by itself.
    Regards,
    Ankur Parab

  • Mapping in OWB with primary key and foreign key relationship

    Hi all,
    I am new to this datawarehousing field. I have just started my career. I have to now create a mapping in owb where a table has a field which is a primary key of another table in the same staging area. If you guys could help me out with the a method it can be created that would be very helpful to me.
    I thought of 2 ideas,
    1. If I can use a look up, but then I am not sure if i can use a lookup for primary key, foreign key relationship. If I can use also, I do not know how to use that.
    2. What if I can directly take that the first table and link the primary key of that table to the second table which uses that primary key of the first table as one of its fields.
    I do not know how feasible these methods are. Please guys help me out.
    Thanks in advance.

    I have a similar case where table a and table b having relation but table a got inserted with data and table b is empty so there no values for foriegn key column in table b to realte with table a.
    Now i want to load table b foriegn key with primary key column values of table a.
    how can we do this in owb
    thanks
    kumar

  • Before delete trigger and foreign key relationship

    Hi,
    I am analysing one database for migration. On one parent table there is before delete trigger , to delete records from child. Also there is foreign key relationship on child table for this parent table.
    When I am deleting a row from parent, message gets displayed as "there are child records found."
    I would like to know, if there is foreign key relatioship then delete trigger on parent does't work, what is exactly happening?

    Could you post that trigger code and the Oracle version as well?
    With basic assumptions, I can't reproduce what you have stated here.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> create table parent (id number primary key);
    Table created.
    SQL> create table child (id number);
    Table created.
    SQL> alter table child add constraint fk_parent foreign key (id) references parent;
    Table altered.
    SQL> create or replace trigger bdr_parent
      2  before delete on parent
      3  for each row
      4  begin
      5  delete from child where id = :old.id;
      6  end;
      7  /
    Trigger created.
    SQL> insert into parent (id) values (1);
    1 row created.
    SQL> insert into child (id) values (1);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> delete from parent where id = 1;
    1 row deleted.
    SQL> select * from parent;
    no rows selected
    SQL> select * from child;
    no rows selected
    SQL> rollback;
    Rollback complete.
    SQL> alter table child drop constraint fk_parent;
    Table altered.
    SQL> alter table child add constraint fk_parent foreign key (id) references parent on delete cascade;
    Table altered.
    SQL> delete from parent where id = 1;
    delete from parent where id = 1
    ERROR at line 1:
    ORA-04091: table SCOTT.CHILD is mutating, trigger/function may not see it
    ORA-06512: at "SCOTT.BDR_PARENT", line 2
    ORA-04088: error during execution of trigger 'SCOTT.BDR_PARENT'
    SQL>

  • PDF Portfolio SDK setup - Navigator project wizard in Flex Builder 4.6 does not show

    Hello, Experts
    I am trying to build PDF Custom Navigator using Adobe PDF Portfolio SDK; however, for some reason, when performing step 3 of installation, Navigator project wizard in Flex Builder  (  4.6 ) would not show;
    The plugins have been extracted to:
    C:\Program Files\Adobe\Adobe Flash Builder 4.6\eclipse\plugins
    The NavigatorSupport folder has been extracted to:
    C:\Program Files\Adobe\Adobe Flash Builder 4.6\eclipse and ( just in case ) to
    C:\Program Files\Adobe\Adobe Flash Builder 4.6\
    any advice would be greatly appreciated
    Best Regards,
    -Alex

    as per Joel's recommendation, used 4.5 instead - that worked just fine

  • Key Figures not showing up in the Query disigner

    I added a key figure to a characteristic as an
    attribute, but it is not showing up in the Query designer
    any idea why
    Raj

    Hi RajShekhar,
    This KF that you have added as an attribute to a char will not be available in the Key Figure section. Open the dimensions and find the char for which you created this attribute. Open up the attributes under it and you should find the KF. If you need to use this KF value in a calculation, then you will need to create a formula variable to pull in its value.
    Hope this helps...

  • Foreign key fields not getting populated in datacontrol palette for EJB app

    Hi,
    I am quite new to ADF and EJB.I developed a jdeveloper application with JSF and EJB tiers.(I am using jdeveloper 10.1.3.5)
    For database the default HR database is used.I created the entities for the EMPLOYEES and DEPARTMENTS table.
    I also created a session bean and a data control for the session bean.
    I am having a JSF page that receives all the details of a new Employee and insert into database (i.e persistEntity)
    But the Employees constructor from the Data control palette is not populating the MANAGERID and DEPARTMENTID fields which are
    the foreign key constraints for the EMPLOYEES table and hence while trying to persist the entity
    with the auto populated fields an error message is thrown.
    If I used ADF BC instead of EJB then i could populate all the fields including MANAGERID and DEPARTMENTID.
    Is it possible to have two text fields for Manager and Department in the jsf to insert the Employee details with EJB as the Model?.
    If possible how do I bind the values of these fields to the Employees entity object in EJB.
    Kindly need your insights on this.
    Thanks,
    Guna.

    Hi,
    How are you using MANAGER_ID and DEPARTMENT_ID fields, are they exposed as Long (or some other numeric type), or did you map them on the entity, something like this
    @ManyToOne
    private Employee manager; // this by default uses the column named MANAGER_ID
    @ManyToOne
    private Department department; // this by default uses the column named DEPARTMENT_ID
    .... If you mapped them (which is the right way), when you create an employee you should set these attributes before persisting the entity, by using employee.setManager(manager) and employee.setDepartment(department). Then, the foreign keys get populated automatically by your persistence provider (Toplink).
    If you are using data controls, it is a little different process to set the department and manager, but you should take a look at this tutorial http://www.oracle.com/technology/obe/obe11jdev/ps1/ejb/ejb.html , it will hopefully answer a lot of your questions.
    Pedja

  • Composite Foreign Key Relationships

    I'm having problems defining relationships that are using the same set of fields in a composite primary key and a composite foreign key. Are there any examples for doing this kind of thing. I think I have the primary keys set up correctly but the foreign key defs aren't working yet. From the spec it looks ike it should be something like this:
    @ManyToOne
         @PrimaryKeyJoinColumns({
         @PrimaryKeyJoinColumn(name="CGMTI_ID"),
         @PrimaryKeyJoinColumn(name="MISSION_REF_DATE")})
         CgmtiHeader cgmtiHeader;
    Also, the composite foreign keys seem to make Dali's entity generation blow up.

    This mapping is missing the referencedcolumn definition, and because it is a composite pk, it cannot figure out a default value. So it should similar to:
    @ManyToOne
    @PrimaryKeyJoinColumns({
    @PrimaryKeyJoinColumn(name="CGMTI_ID", referencedColumnName="CGMTI_ID),
    @PrimaryKeyJoinColumn(name="MISSION_REF_DATE", referencedColumnName="MISSION_REF_DATE)})
    CgmtiHeader cgmtiHeader;
    Similar discussions exist in threads:
    Extra Columns in ManyToMany table workaround
    and
    http://forums.java.net/jive/thread.jspa?threadID=2564&messageID=36441
    both of which list blogs showing examples.
    Best Regards,
    Chris

  • Query Builder - Where Clause - Could not format error using date comparison

    We've come across a bug in the Query Builder, under the Create Where Clause tab, if you select a column of Date type plus one of the comparison operators =, !=, <, >, <=, >=, BETWEEN or NOT BETWEEN it displays an error in the Logging Page:
    Level: Severe
    Source: o.d.r.queryBuilder.SQLGenerator
    Message: Could not format :2010-09-02 16:20:31.0
    Then under the Show SQL tab it doesn't display the date(s) you selected, e.g.
    WHERE LAST_UPDATE BETWEEN AND
    Also the View Results tab does not display any results.
    You can still press Apply to add the SQL as is to the editor window and from there you have to manually code in the date parameters.
    We're using the latest version of SQL Developer 2.1.1.64.45 Windows 32bit version with JDK

    Hi Gordon,
    When I add the following lines:
    declare @refdt1 date
    set @refdt =
    /*select 1 from jdt1 t0 where t0.RefDate*/ '[%1]'
    declare @refdt2 date
    set @refdt =
    /*select 1 from jdt2 t0 where t0.RefDate*/ '[%2]'
    WHERE T0.RefDate >= @refdt1 and T0.RefDate <= @refdt2
    ... the error message is now:
    Must declare the scalar variable @refdt1
    Note: Before adding these lines, the query works perfectly, and returns totals from the whole database (with dynamically generated column headings!)
    Thanks
    Leon Lai
    AMENDED QUERY:
    declare @refdt1 date
    set @refdt1 =
    /*select 1 from jdt1 t0 where t0.RefDate*/ '[%1]'
    declare @refdt2 date
    set @refdt2 =
    /*select 1 from jdt1 t0 where t0.RefDate*/ '[%2]'
    --------- I inserted the 6 lines above ---------------------
    DECLARE @listCol VARCHAR(2000)
    DECLARE @query VARCHAR(4000)
    SELECT @listCol =
    STUFF
    ( SELECT DISTINCT   '],['    +    CAST(month(T0.RefDate) AS varchar)
    FROM  JDT1 T0
    FOR XML PATH('')
    ), 1, 2, ' ') +   ']'
    SET @query =
    'SELECT * FROM
    (SELECT Account, month (T0.RefDate) Month , Debit
    FROM JDT1 T0
    ------------------- I add the WHERE clause below --------------------
    WHERE T0.RefDate >= @refdt1 and T0.RefDate <= @refdt2
    GROUP BY Account, RefDate, Debit
    ) S
    PIVOT
    Sum(Debit)
    FOR Month IN ('+@listCol+')
    ) AS pvt'
    EXECUTE (@query)
    Edited by: LEONLAI on Oct 21, 2011 2:36 PM

  • Key Figures not showing in BEx Workbooks

    Hi,
    Recently we migrated the BW3.5 workbooks to BI7. After the migration and transportation of the workbooks to Quality system, in some of the workbooks the Key figures are not showing up and in some workbooks the key figures which are set as 'Hide" in the query are also showing up.
    Can anyone please suggest a way to fix this issue.
    Thanks in advance.
    Kalyan

    Hi,
    Thanks for your response.
    Even if there is no transaction data for the key figure, it should still show up in the report but as blank column, but in my case the key figure is not at all showing in the report.
    "Hide" setting for key figure is specific only to BEx and is done in the BEx query, which is being used by the Workbooks, so i do not think that it has anything to do with the InfoObject migration.
    Kalyan

  • Position- Central Person relationship not showed

    Hi
    Relationship between Position-Central Person objects is not showed via trx. PPOMA_CRM, but it is present if trx. BP is used.  Could someone help me to solve it, please???
    Thanks everybody

    Yes
    The relationship will get created automatically
    B209  Person to Central Person and this relationship will help you to POST the documents into FICO
    i Mean without the Creation of this Relationship Posting Document cannot be created and if this relationship is not there in the system means
    you will get an error while Hireing an Employee states " No Interval Range Found " but we can hireing the employee
    so, this one is mandatory and this relationshipe will get created from $$$$ in Tcode OONR  and also check Table NRIV
    For more info check the documentation of the follwoing report
    RPU46CX_CENTRAL_PERSON_ONLINE

  • AD contains system Recovery Key, but not showing in MBAM.

    I am in an environment with MBAM 1.0 installed. I built the MDT 2013 system here and am currently trying to figure out why the bitlocker keys are showing up in AD but not MBAM.
    In MDT, I have disabled the "enable bitlocker" options so there shouldn't be a case where that the TPM ownership is wrong (I think). I do however set the
    bios password with CCTK, then apply the default bios configuration with an ini via cctk. The bios sets and activates tpm just before the hard disk is formatted by LTI.
    q1. Could setting the TPM without restarting cause the TPM ownership to be set to the PE in some weird way.
    q1.1. would I clear the tpm if this is the issue?
    So MBAM client is installed on the reference image and captured by MDT. The WIM is then deployed to a system using a standard TS with the bitlocker disabled like
    I mentioned above. I do not make any changes to reg for mbam in the reference image. For testing, I tried adding the mbam recovery key location url to the reference image reg. I still need to test that but a few other tests I did makes me believe this
    is not the case.
    MDT binds the system to a default OU in the domain. After the system is configured, I start Bitlocker. (Sometimes I start bitlocker when the system is in the default
    OU, sometimes I start it after I move them into the right ou for the role). I am almost positive the default OU has the mbam settings (I do not have access to this gpo), since the manage-bde -status comes back AES 128 with diffuser (as compared to regular
    aes 128).
    After bitlocker finishes, the key is found in AD but not mbam.
    I think the major questions I have are:
    How can I force MBAM to take ownership of the TPM after the os is bitlockered? (about 100/700 machines are not reporting to mbam but are to bitlocker because of this new deployment system)
    If I turn TPM on and activate while I was in the PE, would that mean the PE has the TPM ownership? (or bitlocker in this case, since mbam is not installed on the PE)
    - Could I install MBAM on the PE and use that to manage the tpm? (MDT 2013) (I have seen some documents that cover this but it largely comes from wanting a pre-provisioned bitlocker.)
    ** I think the most manual way of correcting the issue I am having, is to either clear the tpm and rebitlocker, or
    .. when a system is about to image, turn tpm on but leave it deactivated. (If I leave the tpm deactivated, every system will need to be manually rebooted and f10 will need to be pressed to continue the bitlocker process. this includeds
    a user login too)

    Keep the MBAM out of the .wim! Install it in task sequence.
    MBAM Client has its own log files in event viewer, there you perhaps find the reason why recovery key is not stored in DP. But fix your image first, keep it thin.

Maybe you are looking for