Two columns in the same table that are foreign keys to the same master key

i want to create a table let say X, which have two columns that are foreign key that reference the same column in the master table, so does this count as bad database design.

here is the full ddl for the two table, where in the second table there are two columns that represent the primary key and they are also two foreign keys to the same columns in the master table (items)
Desc item table;
Item_id
Item_name
Item_price
Item_quantitiy
Create table item_recommendation ( item_id varchar(20), recommended_item varchar(20),
CONSTRAINT recom_primary PRIMARY KEY (item_id, recommended_item),
CONSTRAINT F1 FOREIGN KEY (item_id) REFERENCES items(item_id), ),
CONSTRAINT F2 FOREIGN KEY (recommended_item) REFERENCES items(item_id));

Similar Messages

  • Copying tables that have Foreign Keys

    All my tables are using primary/foreign keys. If you look at the example below, I have a table 'stu_school' which has 3 foreign keys (FK_YEAR,FK_SCHOOL,FK_GRADE_LEVEL) pointing to 3 other tables. Every year I need to create a new record in the year table and copy the data from the previous year (with the FK_YEAR value) into the new year. Is there a better approach to moving this data over other than manually writing SQL statements and making sure they are done in the correct order (becuase of the keys).
    stu_school
    PK_ID
    FK_YEAR
    FK_SCHOOL
    FK_GRADE_LEVEL
    year
    PK_ID
    YEAR
    school
    PK_ID
    SCHOOL
    grade_level
    PK_ID
    FK_YEAR
    FK_SCHOOL
    GRADE_LEVEL

    Since this is going to be an annual task and should therefore be part of the application I suggest writing a pl/sql script that performs the necessary actions rather than use sql to generate the sql to perform the action. A pl/sql script would allow better activity logging and error handling appropriate for a repeating production task.
    IMHO -- Mark D Powell --

  • Re : The Tables that are linked in SAP R3 Datasource

    Can any one mention what are the tables that are link to the sap data sources
    For Eg : 2LIS_11_VAHDR for the given data source what are the tables that are linked , where exactly the theses tables are stored in the database

    Hi,
    You can get this information from SAP documentation.Please check the below link.
    http://help.sap.com/search/highlightContent.jsp
    Regards,
    Raju

  • Is there a way to find the temporary table that are created or read during?

    Hi All,
    I'm working on performance optimization where I have to find the temporary tablespaces that are created or read during runtime? Is there any way to find it?
    Can you please also tell me how the temporary tables are created? And after each run time whether the data is getting deleted or the whole table is getting deleted?
    Whether these tables are created only during runtime? What are the naming conventions for all the temporary tables that are created?
    Is the table creation has anything to do with Delta or Full load?
    Regards,
    Kartik

    Stephen Tyler Bloom wrote:
    When they come out with the next garageband, they should add that feature .
    be sure to let Apple know:
    http://www.bulletsandbones.com/GB/GBFAQ.html#sendfeedback
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • How to know the List of Tables that are updated through a ABAP Program

    Hi,
    Is there a program or something that will help me to identify the List of Tables that are used in a ABAP program(ABAP Report, Transaction .... program) without debugging it or looking at the dictionary structure.
    I really need this urgently. Try to give me many methods as possible.
    Thkx
    Kishan

    Hi,
    I created a Z-transaction for my SE49 and debugged a little bit - it's not so fantastic any longer - just like the proposal of SE80 - DDIC list.
    SE49 (and I guess similiar functions, too) just scan the source code for a list of key words: tables, select, update, insert, modify, export, import.
    But very (very!) often updates are encapsulated into function modules - and here this technical cross reference (just like SE80 DDIC list) is of no help.
    So a SQL trace (or runtime analysis) is still the best option to get a complete list. Still these tools just analysis one process - if in other circumstances more tables are involved, can't be judged.
    E.g.:
    - creating one new entry: 1 table
    - changing existing entry: 2 accesses to 1 table + log table
    Regards,
    Christian

  • How to relate two columns in a same row

    I want to relate two columns in a same row, like if A2 is Jack then B2 to be A, if A2 is Anand then B2 to be B, If A2 is Arun then B2 to be C and so on. How to do it?

    Anand,
    Create a table that lists the relationships:
    Name
    Associated Letter
    Jack
    A
    Anand
    B
    Arun
    C
    Then, use a Lookup function to find the name in the lookup table and return the proper letter to your main table.
    Jerry

  • Creating Column in table or use Foreign Key

    I have a bunch of tables that are year specific, so I need to store the year in the record. I'm not sure if I should create a column in each table called 'year' or create a master 'Year' table and use a foreign key to it in all my other tables. Any advice?
    PK_ID NUMBER Constraint pk1
    PRIMARY KEY
    YEAR VARCHAR2(4)
    --- or----
    PK_ID NUMBER Constraint pk1
    PRIMARY KEY
    FK_YEAR NUMBER Constraint fk_year
    REFERENCES year_table(PK_ID)

    Does your "year" entity have any attributes ?
    Why do you have a year, which to most people seems to be a number, stored as a varchar2(4) ? And what are you going to do about the Y10K problem ?
    How about making the ID of year the numeric value of the year you are storing - then you have eat your cake and have it ;)
    Seriously, though, why do you want a table to say that the year 2008 is the year identified by a meaningless unique number ?
    Regards
    Jonathan Lewis
    http:/jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk

  • How to insert data into two tables linke with foreign key..

    I have two tables
    1)EMP(emp_ID,username,emp_type_code)
    emp_ID is primary key, emp_type_code is a foreign key references emptype table.
    2)emptype(emp_type_code,emp_type_descripton)
    emp_type_code is primary key
    Could anyone help me ..how to insert data into EMP table. How to insert data into two tables linke with foreign key..

    CREATE TABLE "CATDB"."DWDIMUSER"
    "USER_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_ID" NUMBER(10,0),
    "FULLNAME" VARCHAR2(20 BYTE),
    "FNAME" VARCHAR2(20 BYTE),
    "LNAME" VARCHAR2(20 BYTE),
    "USER_SUBTYPE" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMUSER_PK" PRIMARY KEY ("USER_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE,
    CONSTRAINT "DIMUSER_DIMSPECIALTY_FK" FOREIGN KEY ("SPECIALTY_ID") REFERENCES "CATDB"."DWDIMSPECIALTY" ("SPECIALTY_ID") DISABLE
    CREATE TABLE "CATDB"."DIMSPECIALTY"
    "SPECIALTY_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_NAME" VARCHAR2(100 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("SPECIALTY_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
    INSERT INTO DIMUSER (FullName, FNAME, LNAME, USER_TYPE, USER_SUBTYPE)
    SELECT DISTINCT
    Engineer AS FullName,
    regexp_substr(Engineer , '[^,| ]+', 1, 1) as FName,
    regexp_substr(Engineer , '[^,| ]+', 1, 2) as LName ,
    'Engineer'
    FROM EMPLOYEELOOKUP;
    INSERT INTO DIMSPECIALTY (SPECIALTY_NAME)
    SELECT DISTINCT SPECIALITY
    FROM EMPLOYEELOOKUP;
    COMMIT;
    CREATE TABLE employeelookup ...IS A TABLE THAT HAS ALL THE DATA NEDED TO BE FILLED IN BOTHE TABLES...
    CREATE TABLE "CATDB"."EMPLOYEELOOKUP"
    "EMPLOYEELOOKUP_ID" NUMBER(10,0) NOT NULL ENABLE,
    "ENGINEER" VARCHAR2(25 BYTE),
    "SPECIALTY" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("EMPLOYEELOOKUP_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
    DATA IN EMPLOYEELOOKUP
    Engineer, Specialty,
    John, Dow, Electronis,
    Dow, Jons, Technician
    Stan Smithers Sales
    Mark, Richards Marketing
    Jenny, Lane Marketing
    John, Lee Sales
    I NEED TO LOAD THE FOREIGN KEY IN DIMUSER FROM THE DIMSPECIALTY TABLE?
    BY USING THE LOOKUP TABLE TO MARCH THE NAMES UNDER THE Engineer COLUMN, SPECIALTY COLUMNE DISTICTIVLY BY JOINING THE DIMSPECILTY TO RISTIVE THE PRIMARY KEY AND FILL IT IN THE DIMUSER TABLE AS A FOREIGNE KEY.

  • Database adapter - table related by foreign key - not picking

    Hi All,
    we have a Invoke which picks data from database by using the query feature(not polling) of db adapter.
    we are picking data from multiple tables.
    there is foreign key relation between tables,which we have defined at the db adapter.
    Parent - > child 1
    > child 2 > child 3
    > child 4 > child 5
    So we have a case where parent has 3 rows but children tabls have 3000+.
    This error is happening in such cases.
    Please let me know.
    <2009-08-06 16:58:54,833> <ERROR> <default.collaxa.cube.engine> The execution of this instance "90045" for process "XXSOA_ESP4G_ROUT_ABC_SRC" is supposed to be in a jta transaction, but the transaction is not present or in active state, please turn on the application server transaction debug logs to get more information.
    <2009-08-06 16:58:54,842> <WARN> <default.collaxa.cube> <BaseCubeSessionBean::logError> Error while invoking bean "activity manager": Failed due to unhandled bpel fault.
    <2009-08-06 16:58:54,852> <ERROR> <default.collaxa.cube.engine.dispatch> <DispatchHelper::handleMessage> failed to handle message
    ORABPEL-02182
    JTA transaction is not present or the transaction is not in active state.
    The current JTA transaction is not present or it is not in active state when processing activity or instance "90,045". The reason is The execution of this instance "90045" for process "XXSOA_ESP4G_ROUT_ABC_SRC" is supposed to be in a jta transaction, but the transaction is not present or in active state, please turn on the application server transaction debug logs to get more information..
    Please consult your administrator regarding this error.
         at com.collaxa.cube.engine.CubeEngine.store(CubeEngine.java:5514)
         at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5799)
         at com.collaxa.cube.engine.CubeEngine.expireActivity(CubeEngine.java:2086)
         at com.collaxa.cube.ejb.impl.ActivityManagerBean.expireActivity(ActivityManagerBean.java:174)
         at com.collaxa.cube.ejb.impl.ActivityManagerBean.expireActivity(ActivityManagerBean.java:145)
         at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
         at com.evermind.server.ThreadState.runAs(ThreadState.java:693)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at ActivityManagerBean_LocalProxy_4bin6i8.expireActivity(Unknown Source)
         at com.collaxa.cube.engine.dispatch.message.instance.ExpirationMessageHandler.handle(ExpirationMessageHandler.java:43)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:141)
         at com.collaxa.cube.engine.dispatch.BaseDispatchTask.run(BaseDispatchTask.java:58)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
         at java.lang.Thread.run(Thread.java:595)
    <2009-08-06 16:58:54,853> <ERROR> <default.collaxa.cube.engine.dispatch> <DispatchHelper::handleMessage> Not fatal connection error ... not retrying: class com.collaxa.cube.engine.UnhandledFaultException: Failed due to unhandled bpel fault.
    <2009-08-06 16:58:54,854> <ERROR> <default.collaxa.cube.engine.dispatch> <BaseDispatchTask::run> Failed to handle dispatch message ... exception ORABPEL-05002
    Message handle error.
    An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.instance.ExpirationMessage"; the exception is: JTA transaction is not present or the transaction is not in active state.
    The current JTA transaction is not present or it is not in active state when processing activity or instance "90,045". The reason is The execution of this instance "90045" for process "XXSOA_ESP4G_ROUT_ABC_SRC" is supposed to be in a jta transaction, but the transaction is not present or in active state, please turn on the application server transaction debug logs to get more information..
    Please consult your administrator regarding this error.
    ORABPEL-05002
    Message handle error.
    An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.instance.ExpirationMessage"; the exception is: JTA transaction is not present or the transaction is not in active state.
    The current JTA transaction is not present or it is not in active state when processing activity or instance "90,045". The reason is The execution of this instance "90045" for process "XXSOA_ESP4G_ROUT_ABC_SRC" is supposed to be in a jta transaction, but the transaction is not present or in active state, please turn on the application server transaction debug logs to get more information..
    Please consult your administrator regarding this error.
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:206)
         at com.collaxa.cube.engine.dispatch.BaseDispatchTask.run(BaseDispatchTask.java:58)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
         at java.lang.Thread.run(Thread.java:595)

    Also for above issue , we increased the timeout in transaction manager
    transaction-timeout and syncMaxWaitTime properties as follows:
    Property     File Location     This Value Must Be...     Example
    transaction-timeout     SOA_Oracle_Home\j2ee\home\config\transaction-manager.xml     Larger than the transaction-timeout value in orion-ejb-jar.xml and the syncMaxWaitTime value.     7200
    transaction-timeout     SOA_Oracle_Home\j2ee\home\application-deployments\orabpel\ejb_ob_engine\orion-ejb-jar.xml     Less than the transaction-timeout value in transaction-manager.xml.
    Note: You must set all transaction-timeout properties that display in this file.     3600
    syncMaxWaitTime     SOA_Oracle_Home\bpel\domains\domain_name\config\domain.xml
    where domain_name is the name of the domain to which you are deploying.     Less than the transaction-timeout value in orion-ejb-jar.xml.     240
    2.     
    The above refernece was useful in resolcing our issue.
    Regards
    Arc

  • Records in a table that are not older than two weeks

    Hey everyone,
    I have a mysql table which has a column DATE which contains the date the enty was inserted
    I need to write a script which keeps only those records that are no older than two weeks.
    Can this be done in sql?
    I can do it in Java but I guess this is not the most efficient way.
    I use jsp and servlets in my app.

    I just tried out the above code:
    DELETE FROM myTableHere  WHERE DATE_SUB(CURDATE(),INTERVAL 14 DAY) <= DATE;This is the error that I got:
    mysql> DELETE FROM myTableHere WHERE DATE_SUB(CURDATE(),INTERVAL 14 DAY) <= DATE;
    ERROR 1054 (42S22): Unknown column 'DATE' in 'where clause'
    mysql>
    my sql table has the currentDate column which specifies the current date and time when this entry was inserted into the DB. To get current date and time I use 'now()' function of sql.
    what is the problem?
    Thanks.

  • T-SQL - Using Column Name in where condition without any references when having multiple tables that are engaged using multiple joins.

    Hi All,
    I am a newbie for T-Sql, I came across a SP where multiple tables are engaged using multiple joins but the where clause contain  a column field without any table reference  and assigned  for an incoming variable,like 
    where 'UserId = @UserId'
    instead -  no table reference like 'a.UserId = @Userid'   ............ Can any please do refer to me any material that clears my mind regarding such issue................... help is appreciated.
    Thank You.

    As suggested above, use table alias with columns for unique referencing and to make the code easier to read.
    BOL example for table aliasing:
    USE AdventureWorks;
    GO
    SELECT S.CustomerID, S.Name AS Store, A.City, SP.Name AS State, CR.Name
    AS CountryRegion
    FROM Sales.Store AS S
    JOIN Sales.CustomerAddress AS CA ON CA.CustomerID = S.CustomerID
    JOIN Person.Address AS A ON A.AddressID = CA.AddressID
    JOIN Person.StateProvince SP ON
    SP.StateProvinceID = A.StateProvinceID
    JOIN Person.CountryRegion CR ON
    CR.CountryRegionCode = SP.CountryRegionCode
    ORDER BY S.CustomerID ;
    GO
    GO
    LINK:
    http://technet.microsoft.com/en-us/library/ms124824(v=sql.100).aspx
    Check the use of TABLE ALIASes and COLUMN ALIASes in the following blog:
    http://www.sqlusa.com/bestpractices2005/organizationtree/
    Without the use of aliases the code would become unreadable.
    Kalman Toth Database & OLAP Architect
    Free T-SQL Scripts
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Check two columns and update other table

    HI ,
    I have a table called trackCenterline .Below is the table.
    What i want to do is If the segmentSequenceID is 1 it should pick the corresponding SegmentID i.e 10001 and Check for the same segment id in other table called TrackSegment which is below.  and pick the BeginMilepost of that segmentID and Update That
    Milepost in a new table .At end SegmentSequenceID number it should pick ENDMilepost and update
    TrackCenterline table.
    TrackSegment table
    In the below table for 10001 SegmentID it should pick BeginMilepost. For end Number of SegmentSequenceID in above table ID ends at 121 for that end sequenceID It should refer TrackSegment table below and pick EndMilepost and should be updated in another
    table Milepost column.
    after that a new segment starts with new sequence .and so on ...
    bhavana

    Hi Deepa_Deepu,
    According to your description, since the issue regards T-SQL. I will help you move the question in the T-SQL forums at
    http://social.technet.microsoft.com/Forums/en-US/home?forum=transactsql. It is appropriate and more experts will assist you.
    When you want to check two columns from two tables then return some results and update the third table. I recommend you use join function and combine two tables, then use update select from statement for modifying the Mailpost table. You can refer to the
    following T-SQL Statement.
    -----using join to connect to two tables
    select TrackCenterline.FeatureId,TrackCenterline.SegmentId,
    TrackCenterline.SegmentSequenceId,TrackSegment.BeginMilepost,TrackSegment.EndMilepost
    from dbo.TrackCenterline join dbo.TrackSegment
    on TrackCenterline.SegmentId=TrackSegment.SegmentId
    order by TrackCenterline.SegmentId, TrackCenterline.SegmentSequenceId
    ---the result shows as following.
    FeatureId SegmentId SegmentSequenceId BeginMilepost EndMilepost
    AMK100011 10001 1 61.0000 61.3740
    AMK100012 10001 2 61.0000 61.3740
    AMK100013 10001 3 61.0000 61.3740
    AMK1000121 10001 121 61.0000 61.3740
    AMK100021 10002 1 61.1260 61.7240
    AMK100023 10002 3 61.1260 61.7240
    AMK100033 10003 3 61.3740 62.9530
    -----Then you can use update select from statement to modify the Mailpost table, Or you can post the table structure of Mailpost
    And for more information, you can review the following article about update statement.
    http://www.techonthenet.com/sql/update.php
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Can I create tables that are subsets of my master table?

    I would like to create tables (or sheets) that are subsets of the master table so that I can view different subsets of data in smaller chunks. I would like to continue to enter data in the master - and have it reflected in the subsets. Possible?
    Thank you

    Would this do what you want?
    Create a table for your subset of info. In its first cell, enter "=" & then click on the cell in the master table that you want displayed in that cell of the new table. You will get a formula of the type:
    =Table 1 :: B2
    where "B2" will be whatever cell you clicked on in Table 1.
    You can extend this formula downward or rightward with the circular blue fill handle to easily display adjacent row or column cells from the master table. You can also repeat the process starting with a new cell in the new table to display as many or as few cells of the master as you want. (You could even display different row or column values from the master in the same row or column of the new table, but I'm not sure that would be of any use.)
    Once you get the subset table set up as you want, lock it so that you cannot accidentally change its cell contents to something else.
    The result is a table slaved to the master which will automatically show any changes to the master but otherwise cannot be altered. This table can also be copied to other sheets & the formulas will be updated with the sheet reference automatically.
    The only drawbacks to this approach that I know of are that you can't enter data into the subset table (which may be a good or bad thing) & that empty cells in the master will be represented by zeros in the subset table. An 'IF(ISBLANK())" formula addition would take care of that but may not be needed.

  • Tables that are frequently deleted

    I was wondering if anyone out there had some suggestions on how to deal with this problem.
    We have a participants table that stores all the participants in a program.
    During an enrollment period we may have several thousand new participants that may choose to enroll in a program.
    After enrollment we delete all the participants who haven't enrolled in a program.
    Should I create a separate table called new_participants and just truncate it after each enrollment, or should we leave all records in the same table and delete unused records after enrollment?

    truncate is an option if performance is becoming a problem and there are a large number of full table scans from the application. Otherwise, this is not requried.

  • Creating FK's in tables that are all ready created

    Good afternoon,
    I have 4 tables set up, and need to create foreign keys in three on them relating back to my EMPLOYEE table. The FK will be based on the employee number column in the EMPLOYEE table.
    Once these tables are created and populated, how do I link a PK to a FK, and how do I create a FK in a table that is already created.
    Many Thanks,
    -Robert

    Hello Robert,
    you can do that with APEX as well:
    1. Login to your workspace
    2. Go into "SQL Workshop"
    3. Start the "Object Browser"
    4. Select "Tables" (if not selected already)
    5. Pick your desired table (e.g. CONSULTING) from the table list
    6. Click on "Contraints" in the detail view
    7. Click on "Create"
    8. Enter your desired Contraint Name (e.g. CONSULTING_FK)
    9. Chose your desired Contraint Type (e.g. Foreign Key)
    10. Chose your option for action on delete for that key (see lakes post above)
    11. Chose the column that contains the foreign key (e.g. Cnslt_Emp)
    12. Chose the table to be referenced (e.g. EMPLOYEE)
    13. Chose the column to be reference (e.g. Emp_Num)
    14. Continue
    15. Check if all settings are correct, see the SQL statement if you want, and click Finish.
    To learn more about what you can do with the Object Browser and the other components in the SQL Workshop, you might want to study the [url http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15520/toc.htm]APEX SQL Workshop Guide. It contains step-by-step guides for almost all functionality you'll need in every day life.
    -Udo

Maybe you are looking for

  • How to pass values to Oracle store procedure in Crystal Report

    Hi all, I am newbie on passing values to stored procedure parameters. I created a Crystal Report using the Crystal Report wiward with PULL method and data come from Oracle stored procedure. In an ASP.NET page, I have stored two values in Session and

  • IWeb: problem with comments

    On my iWeb page I have comments allowed on my blog. Yet no one can post comments. If I publish a new article with the comments allowed, iWeb comes back with an error server message. Mac OS X 10.5.4 iWeb 2.0.4

  • Mulitple line data

    Hi,   I have to display shipping address of line items in the item level when different line items have different delivery address. How to display this in the line item table only.After every line item the address has to be displayed in the item tabl

  • OO4O 9.2.0.4.8 production release is available

    OO4O 9.2.0.4.8 production release is available for download on OTN. New Features ============ New Features supported for the 32-bit In Process OLE Automation Server: With this release, OO4O provides four new objects that enable developers to access a

  • Exporting iMovie6 to WMV file

    Hello, I have a almost 4 minute iMovie. When I try and export it to a .wmv, it only saves/compresses 30 seconds of it. I have tried using the default settings, and at least one setting under the three different category types and I get the same resul