Unable to choose foreign key when creating reference partition

Hello
I have 2 foreign keys on a table. I am trying to choose the 2nd foreign key when creating a reference partition. I am unable to select the required foreign key.
The model has Table A -> Table B -> Table C. Table A has a list partition. Table B is the child of Table A. I created a reference partition on Table B. Table C is child of Table B. There are 2 FKs on table C. I am unable to choose the required FK to create reference partition on table C.
SQL Developer version - 3.0.0.665
Any help would be appreciated.

Hi,
The FK that can be selected is normally the oldest FK that was created for the Table.
So one option would be to delete and then recreate the FK that is selectable. This process may need to be repeated if there are several FKs that are "older" than the one you wish to use for Reference Partitioning.
David

Similar Messages

  • Can I create a foreign key when creating Business Components from Tables

    Hi,
    I would like to use ADF and JSF to create an application on our database. My problem is our database does not "conform". i.e. there are no foreign key constraints.
    When I create a "Business Component from Tables" view, can I put in my own joins between tables so enabling the use of the generated views?
    Jon L.

    View object instances show up in the data control palette once you've added them to your application module's data model.
    See these sections in the ADF Developer's Guide for more information:
    Section 2.6.3, "Using View Objects in the Application Module's Data Model" talks about using view object instance in the data model as part of the overview chapter.
    Section 4.5, "Understanding the Active Data Model" explains a little more about this
    Section 5.3, "Using a View Object in an Application Module's Data Model" shows how to do this.
    Chapter 10, "Overview of Application Module Data Binding" gives details on how the application and its view objects are exposed in the Data Control palette.
    You can find the guide on the ADF Learning Center on OTN.
    http://www.oracle.com/technology/products/adf/learnadf.html
    Look for the ADF Developer's Guide for Forms/4GL Developers.

  • Foreign keys at the table partition level

    Anyone know how to create and / or disable a foreign key at the table partition level? I am using Oracle 11.1.0.7.0. Any help is greatly appreciated.

    Hmmm. I was under the impression that Oracle usually ignores indices on columns with mostly unique and semi-unique values and prefers to do full-table scans instead on the (questionable) theory that it takes almost as much time to find one or more semi-unique entries in an index with a billion unique values as it does to just scan through three billion fields. Though I tend to classify that design choice in the same category as Microsoft's design decision to start swapping ram out to virtual memory on a PC with a gig of ram and 400 megs of unused physical ram on the twisted theory that it's better to make the user wait while it needlessly thrashes the swapfile NOW than to risk being unable to do it later (apparently, a decision that has its roots in the 4-meg win3.1 era and somehow survived all the way to XP).

  • Bug: no constraints/foreign keys when Scripter.Prefetch = true

    Kind of bug report, using assemblies version v11.0.0.0 and ScriptingOptions.DriAll = true.
    When you have tables with foreign keys or other constraints, these are not scripted when you pass urns of all tables to Scripter.Script which has Prefetch property set to true. I believe this is due to a bug in prefetching.
    To workaround, set Scripter.Prefetch = false. Strange enough, passing urns of subset of the tables works as well (even excluding one table only), which results in the "constraints are returned when passing single urn only" reported behavior.

    Hi, sure, sorry for late reply.
    This is the DB create script:
    DROP DATABASE [TestDB]
    USE [master]
    GO
    CREATE DATABASE [TestDB] CONTAINMENT = NONE ON PRIMARY
    ( NAME = N'TestDB', FILENAME = N'C:\Windows\Temp\Test.mdf' , SIZE = 5120KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LOG ON
    ( NAME = N'TestLG', FILENAME = N'C:\Windows\Temp\Test.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
    GO
    ALTER DATABASE [TestDB] SET COMPATIBILITY_LEVEL = 110
    GO
    ALTER DATABASE [TestDB] SET ANSI_NULL_DEFAULT OFF
    ALTER DATABASE [TestDB] SET ANSI_NULLS OFF
    ALTER DATABASE [TestDB] SET ANSI_PADDING OFF
    ALTER DATABASE [TestDB] SET ANSI_WARNINGS OFF
    ALTER DATABASE [TestDB] SET ARITHABORT OFF
    ALTER DATABASE [TestDB] SET AUTO_CLOSE OFF
    ALTER DATABASE [TestDB] SET AUTO_CREATE_STATISTICS ON
    ALTER DATABASE [TestDB] SET AUTO_SHRINK OFF
    ALTER DATABASE [TestDB] SET AUTO_UPDATE_STATISTICS ON
    ALTER DATABASE [TestDB] SET CURSOR_CLOSE_ON_COMMIT OFF
    ALTER DATABASE [TestDB] SET CURSOR_DEFAULT GLOBAL
    ALTER DATABASE [TestDB] SET CONCAT_NULL_YIELDS_NULL OFF
    ALTER DATABASE [TestDB] SET NUMERIC_ROUNDABORT OFF
    ALTER DATABASE [TestDB] SET QUOTED_IDENTIFIER OFF
    ALTER DATABASE [TestDB] SET RECURSIVE_TRIGGERS OFF
    ALTER DATABASE [TestDB] SET DISABLE_BROKER
    ALTER DATABASE [TestDB] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
    ALTER DATABASE [TestDB] SET DATE_CORRELATION_OPTIMIZATION OFF
    ALTER DATABASE [TestDB] SET TRUSTWORTHY OFF
    ALTER DATABASE [TestDB] SET ALLOW_SNAPSHOT_ISOLATION OFF
    ALTER DATABASE [TestDB] SET PARAMETERIZATION SIMPLE
    ALTER DATABASE [TestDB] SET READ_COMMITTED_SNAPSHOT OFF
    ALTER DATABASE [TestDB] SET HONOR_BROKER_PRIORITY OFF
    ALTER DATABASE [TestDB] SET RECOVERY SIMPLE
    ALTER DATABASE [TestDB] SET MULTI_USER
    ALTER DATABASE [TestDB] SET PAGE_VERIFY CHECKSUM
    ALTER DATABASE [TestDB] SET DB_CHAINING OFF
    ALTER DATABASE [TestDB] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )
    ALTER DATABASE [TestDB] SET TARGET_RECOVERY_TIME = 0 SECONDS
    ALTER DATABASE [TestDB] SET READ_WRITE
    GO
    USE [TestDB]
    GO
    CREATE TABLE [dbo].[KeySource] (
    [ID] [smallint] IDENTITY(1,1) NOT NULL,
    CONSTRAINT [PK_Reservation] PRIMARY KEY CLUSTERED ([ID] ASC)
    WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    CREATE TABLE [dbo].[KeyUse] (
    [UseID] [smallint] NOT NULL,
    [Row] [tinyint] NOT NULL,
    [Column] [tinyint] NOT NULL,
    CONSTRAINT [PK_KeySource] PRIMARY KEY CLUSTERED ([UseID] ASC, [Row] ASC, [Column] ASC)
    WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
    CONSTRAINT [IX_ReservationSeats] UNIQUE NONCLUSTERED ([Row] ASC, [Column] ASC)
    WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    ALTER TABLE [dbo].[KeyUse] WITH CHECK ADD CONSTRAINT [FK_Source_Use] FOREIGN KEY([UseID]) REFERENCES [dbo].[KeySource] ([ID])
    ON UPDATE CASCADE
    ON DELETE CASCADE
    ALTER TABLE [dbo].[KeyUse] CHECK CONSTRAINT [FK_Source_Use]
    ALTER TABLE [dbo].[KeyUse] WITH CHECK ADD CONSTRAINT [FK_Use_Use] FOREIGN KEY([UseID], [Row], [Column]) REFERENCES [dbo].[KeyUse] ([UseID], [Row], [Column])
    ALTER TABLE [dbo].[KeyUse] CHECK CONSTRAINT [FK_Use_Use]
    This is the code:
    ServerConnection serverConnection = new ServerConnection("server", "user", "pwd");
    Server server = new Server(serverConnection);
    Database database = server.Databases["TestDB"];
    Urn[] urns = database.EnumObjects(DatabaseObjectTypes.Table).Rows.OfType<DataRow>().Select(r => new Urn((string)r["Urn"])).Take(2).ToArray();
    Scripter s = new Scripter(server);
    s.Options.DriAll = true;
    StringCollection result = s.Script(urns);
    This is the result:
    SET ANSI_NULLS ON
    SET QUOTED_IDENTIFIER ON
    CREATE TABLE [dbo].[KeySource](
    [ID] [smallint] IDENTITY(1,1) NOT NULL
    ) ON [PRIMARY]
    SET ANSI_NULLS ON
    SET QUOTED_IDENTIFIER ON
    CREATE TABLE [dbo].[KeyUse](
    [UseID] [smallint] NOT NULL,
    [Row] [tinyint] NOT NULL,
    [Column] [tinyint] NOT NULL
    ) ON [PRIMARY]
    Note that the constraints are missing.
    As already noted, adding s.PrefetchObjects = false; line fixes this.
    But let's do the magic way - supplying less Urns than there actually is tables. To test this, add a dummy table to the DB:
    USE [TestDB]
    CREATE TABLE [dbo].[DummyTable]([Test] [nchar](10) NULL) ON [PRIMARY]
    Run the code again. Note that the Take(2) method limits the Urns supplied to the Scripter to the same set as before.
    However, the result is now:
    SET ANSI_NULLS ON
    SET QUOTED_IDENTIFIER ON
    CREATE TABLE [dbo].[KeySource](
    [ID] [smallint] IDENTITY(1,1) NOT NULL,
    CONSTRAINT [PK_Reservation] PRIMARY KEY CLUSTERED
    [ID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    SET ANSI_NULLS ON
    SET QUOTED_IDENTIFIER ON
    CREATE TABLE [dbo].[KeyUse](
    [UseID] [smallint] NOT NULL,
    [Row] [tinyint] NOT NULL,
    [Column] [tinyint] NOT NULL,
    CONSTRAINT [PK_KeySource] PRIMARY KEY CLUSTERED
    [UseID] ASC,
    [Row] ASC,
    [Column] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
    CONSTRAINT [IX_ReservationSeats] UNIQUE NONCLUSTERED
    [Row] ASC,
    [Column] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    ALTER TABLE [dbo].[KeyUse] WITH CHECK ADD CONSTRAINT [FK_Source_Use] FOREIGN KEY([UseID])
    REFERENCES [dbo].[KeySource] ([ID])
    ON UPDATE CASCADE
    ON DELETE CASCADE
    ALTER TABLE [dbo].[KeyUse] CHECK CONSTRAINT [FK_Source_Use]
    ALTER TABLE [dbo].[KeyUse] WITH CHECK ADD CONSTRAINT [FK_Use_Use] FOREIGN KEY([UseID], [Row], [Column])
    REFERENCES [dbo].[KeyUse] ([UseID], [Row], [Column])
    ALTER TABLE [dbo].[KeyUse] CHECK CONSTRAINT [FK_Use_Use]
    By testing on larger database I have noticed it does not really matter which table is excluded from the list.
    Hope this helps,
    Jan

  • Accurate statistics on skewed foreign key when coming from parent

    Hi,
    I will be as short as possible:
    - we have two tables in a parent - child relationship. The foreign key is very skewed and we need to get child details coming from the parent
    - CBO is not considering the skeweness from histograms on foreign key column (I suppose it cannot as it is the example without going into tables) and it calculates the expected returning rows in the execution plan as no_rows / distinct_values => 10,000 / 3 = 3,333 rows for both execution plans, even if they returns effectively 1 row / 9,999 rows. In histograms exists this information but it cannot be extracted by CBO as it is.
    Any idea how to help CBO to choose separate execution plans for query 1 and query 2 excluding hints or query modifications?
    -- Oracle Database 10.2.0.3
    --DROP TABLE child;
    --DROP TABLE parent;
    CREATE TABLE parent AS SELECT LEVEL parent_num, 'parent_' || LEVEL parent_id FROM DUAL CONNECT BY LEVEL <= 10;
    ALTER TABLE parent ADD CONSTRAINT parent_pk PRIMARY KEY (parent_num);
    CREATE UNIQUE INDEX parent_id_ix ON PARENT (parent_id, parent_num);
    CREATE TABLE child AS SELECT DECODE (LEVEL, 1, 1, 10000, 10, 5) parent_num, 'child_' || LEVEL child_id FROM DUAL CONNECT BY LEVEL <= 10000;
    ALTER TABLE child ADD FOREIGN KEY (parent_num) REFERENCES parent (parent_num) ON DELETE CASCADE;
    CREATE INDEX child_parent_num_ix ON CHILD(parent_num);
    exec dbms_stats.gather_table_stats(ownname=>'***REPLACE WITH YOUR OWN USER***',tabname=>'PARENT',estimate_percent=>100,cascade=>TRUE,method_opt=>'FOR ALL COLUMNS SIZE 1');
    exec dbms_stats.gather_table_stats(ownname=>'***REPLACE WITH YOUR OWN USER***',tabname=>'CHILD',estimate_percent=>100,cascade=>TRUE,method_opt=>'FOR COLUMNS parent_num SIZE 3, child_id SIZE 1');
    -- QUERY 1: this query should be very selective (1 row), using index
    SELECT c.child_id FROM child c, parent p WHERE c.parent_num = p.parent_num AND p.parent_id = 'parent_1';
    -- QUERY 2: it should return 99.9999% of the rows (9,999 rows), so it should use full table scan
    SELECT c.child_id FROM child c, parent p WHERE c.parent_num = p.parent_num AND p.parent_id = 'parent_5';
    In reality both queries have the same execution plan as below:
    Execution Plan
    Plan hash value: 4033709836
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 3333 | 83325 | 6 (0)| 00:00:01 |
    | 1 | NESTED LOOPS | | 3333 | 83325 | 6 (0)| 00:00:01 |
    | 2 | TABLE ACCESS BY INDEX ROWID| PARENT | 1 | 12 | 1 (0)| 00:00:01 |
    |* 3 | INDEX UNIQUE SCAN | PARENT_ID_IX | 1 | | 0 (0)| 00:00:01 |
    |* 4 | TABLE ACCESS FULL | CHILD | 3333 | 43329 | 5 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    3 - access("P"."PARENT_ID"='parent_1')
    4 - filter("C"."PARENT_NUM"="P"."PARENT_NUM")
    Execution Plan
    Plan hash value: 4033709836
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 3333 | 83325 | 6 (0)| 00:00:01 |
    | 1 | NESTED LOOPS | | 3333 | 83325 | 6 (0)| 00:00:01 |
    | 2 | TABLE ACCESS BY INDEX ROWID| PARENT | 1 | 12 | 1 (0)| 00:00:01 |
    |* 3 | INDEX UNIQUE SCAN | PARENT_ID_IX | 1 | | 0 (0)| 00:00:01 |
    |* 4 | TABLE ACCESS FULL | CHILD | 3333 | 43329 | 5 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    3 - access("P"."PARENT_ID"='parent_5')
    4 - filter("C"."PARENT_NUM"="P"."PARENT_NUM")
    column table_name format A10
    column column_name format A11
    column endpoint_actual_value format A21
    select * from user_tab_histograms where table_name='CHILD' and column_name='PARENT_NUM';
    TABLE_NAME COLUMN_NAME ENDPOINT_NUMBER ENDPOINT_VALUE ENDPOINT_ACTUAL_VALUE
    CHILD PARENT_NUM 1 1
    CHILD PARENT_NUM 9999 5
    CHILD PARENT_NUM 10000 10
    3 rows selected.
    I am sorry about the formatting but this is the best I could following plain text help.
    Thank you,
    Eugen
    Edited by: Eugen Iacob on Dec 13, 2011 3:21 AM
    Edited by: Eugen Iacob on Dec 13, 2011 12:36 PM
    Edited by: Eugen Iacob on Dec 13, 2011 12:37 PM
    Edited by: Eugen Iacob on Dec 14, 2011 2:13 AM

    Hi,
    you can create a function based index on child table, and query that value instead of parent_id from parent table.
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    CREATE TABLE parent AS SELECT LEVEL parent_num, 'parent_' || LEVEL parent_id, 'some text ' || level parent_name
    FROM DUAL CONNECT BY LEVEL <= 10;
    ALTER TABLE parent ADD CONSTRAINT parent_pk PRIMARY KEY (parent_num);
    CREATE UNIQUE INDEX parent_id_ix ON PARENT (parent_id, parent_num);
    CREATE TABLE child AS SELECT DECODE (LEVEL, 1, 1, 10000, 10, 5) parent_num, 'child_' || LEVEL child_id,
    'some text ' || level child_name
    FROM DUAL CONNECT BY LEVEL <= 10000;
    ALTER TABLE child ADD FOREIGN KEY (parent_num) REFERENCES parent (parent_num) ON DELETE CASCADE;
    CREATE INDEX child_parent_num_ix ON CHILD(parent_num);
    CREATE OR REPLACE function get_parent_id( in_parent_num in number )
    RETURN parent.parent_id%TYPE
    DETERMINISTIC
    IS
      ret parent.parent_id%TYPE;
    BEGIN
      SELECT parent_id INTO ret
      FROM parent
      WHERE parent_num = in_parent_num;
      RETURN ret;
    END;
    CREATE INDEX child_parent_id_idx ON child( get_parent_id( parent_num ) );
    exec dbms_stats.gather_table_stats(ownname=>user,tabname=>'CHILD',estimate_percent=>100,cascade=>TRUE,method_opt=>'FOR ALL HIDDEN COLUMNS');
    explain plan for
    SELECT p.parent_name, c.child_name
    FROM child c, parent p
    WHERE c.parent_num = p.parent_num AND get_parent_id(c.parent_num ) = 'parent_1';
    select * from table( dbms_xplan.display );
    plan FOR succeeded.
    PLAN_TABLE_OUTPUT                                                                                                                                                                                                                                                                                           
    Plan hash value: 3790918082                                                                                                                                                                                                                                                                                 
    | Id  | Operation                    | Name                | Rows  | Bytes | Cost (%CPU)| Time     |                                                                                                                                                                                                        
    |   0 | SELECT STATEMENT             |                     |     1 |    77 |     3   (0)| 00:00:01 |                                                                                                                                                                                                        
    |   1 |  NESTED LOOPS                |                     |     1 |    77 |     3   (0)| 00:00:01 |                                                                                                                                                                                                        
    |   2 |   TABLE ACCESS BY INDEX ROWID| CHILD               |     1 |    37 |     2   (0)| 00:00:01 |                                                                                                                                                                                                        
    |*  3 |    INDEX RANGE SCAN          | CHILD_PARENT_ID_IDX |     1 |       |     1   (0)| 00:00:01 |                                                                                                                                                                                                        
    |   4 |   TABLE ACCESS BY INDEX ROWID| PARENT              |     1 |    40 |     1   (0)| 00:00:01 |                                                                                                                                                                                                        
    |*  5 |    INDEX UNIQUE SCAN         | PARENT_PK           |     1 |       |     0   (0)| 00:00:01 |                                                                                                                                                                                                        
    Predicate Information (identified by operation id):                                                                                                                                                                                                                                                         
       3 - access("TEST"."GET_PARENT_ID"("PARENT_NUM")='parent_1')                                                                                                                                                                                                                                              
       5 - access("C"."PARENT_NUM"="P"."PARENT_NUM")                                                                                                                                                                                                                                                            
    Note                                                                                                                                                                                                                                                                                                        
       - dynamic sampling used for this statement                                                                                                                                                                                                                                                               
    22 rows selected
    explain plan for
    SELECT  p.parent_id, c.child_id
    FROM child c, parent p
    WHERE c.parent_num = p.parent_num AND get_parent_id(c.parent_num ) = 'parent_5';
    select * from table( dbms_xplan.display );
    plan FOR succeeded.
    PLAN_TABLE_OUTPUT                                                                                                                                                                                                                                                                                           
    Plan hash value: 2656363181                                                                                                                                                                                                                                                                                 
    | Id  | Operation          | Name         | Rows  | Bytes | Cost (%CPU)| Time     |                                                                                                                                                                                                                         
    |   0 | SELECT STATEMENT   |              |  9998 |   732K|    23  (27)| 00:00:01 |                                                                                                                                                                                                                         
    |*  1 |  HASH JOIN         |              |  9998 |   732K|    23  (27)| 00:00:01 |                                                                                                                                                                                                                         
    |   2 |   INDEX FULL SCAN  | PARENT_ID_IX |    10 |   380 |     1   (0)| 00:00:01 |                                                                                                                                                                                                                         
    |*  3 |   TABLE ACCESS FULL| CHILD        |  9998 |   361K|    21  (24)| 00:00:01 |                                                                                                                                                                                                                         
    Predicate Information (identified by operation id):                                                                                                                                                                                                                                                         
       1 - access("C"."PARENT_NUM"="P"."PARENT_NUM")                                                                                                                                                                                                                                                            
       3 - filter("GET_PARENT_ID"("C"."PARENT_NUM")='parent_5')                                                                                                                                                                                                                                                 
    Note                                                                                                                                                                                                                                                                                                        
       - dynamic sampling used for this statement                                                                                                                                                                                                                                                               
    20 rows selected

  • Lost about 60-75% of my primary and foreign keys when Migrating from SQL Server 7

    Hi All,
    I did an almost successful migration between SQL Server 7.0 and Oracle9i.
    What happened:
    I seem to have lost my primary and foreign keys in the migration. The funny thing is when I viewed the constraints and indexes in Toad, they were there. However when I tried to enabled those constraints nothing happened.
    I really don't know how I can fixed this, but I don't understand why I didn't get a warning or an error message in the Migration Workbench (latest version).
    I did ignore the following errors, could that have anything to do with the keys being lost.
    Failed to create User:omwb_emulation; ORA-1920: user name "OMWB_EMULATION" conflicts with another user or role name
    Failed to create User:guest;ORA-01920: user name "GUEST" conflicts with another user or role name
    These users do not own any objects therefore I ignored them.
    Please advise
    Thanks

    Hi Joe,
    Not sure why you are able to see these objects and yet not able to enable them. Did you encounter any errors during the create Oracle Model phase?? Did you encounter any errors during the final Migrate phase?
    Also, it is really important to have a tablespace created before an attempt is made to create tables and indexes in the destination Oracle database.
    Regards
    John

  • Unable to drop foreign key on a version-enabled table

    Hi,
    We're using Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit and I'm trying to delete a foreign key from a version-enabled table.
    The constraint shows in ALL_WM_RIC_INFO view. I run exec dbms_wm.beginddl('tablename'), when I inspect the generated <tablename>_LTS I don't see any referential integrity constraints generated on that table ? The constraint i'm trying to delete is from a version-enabled table to a non-version enabled table if that makes a difference.
    From what I understand the referential integrity constraint would be generated and I would be able to run something like:
    ALTER TABLE <tablename>_LTS DROP CONSTRAINT <constraintname>.
    I tried running the above statement using the RIC_NAME from ALL_WM_RIC_INFO view but it fails predictably with:
    ORA-02443: Cannot drop constraint - nonexistent constraint
    Cause: alter table drop constraint <constraint_name>
    Action: make sure you supply correct constraint name.

    as I ran into this today as well I feel like answering this question, as I suppose that the thread opener did the same mistake as I did, and maybe
    some others do it as well :)
    of course you need to open a DDL session on the parent table as well in order to drop foreign key constraints, just as you do when you add them.
    so the correct order to make it work would be:
    EXECUTE DBMS_WM.BeginDDL('PARENT_TABLE');
    EXECUTE DBMS_WM.BeginDDL('CHILD_TABLE');
    ALTER TABLE CHILD_TABLE_LTS
    DROP CONSTRAINT FOREIGN_KEY_NAME
    EXECUTE DBMS_WM.CommitDDL('CHILD_TABLE');
    EXECUTE DBMS_WM.CommitDDL('PARENT_TABLE');I felt kind of stupid that it took me 1 hour to figure this out ;)
    regards,
    Andreas

  • $$$ Non-fatal error (1202): Foreign Key 'FCM_1_CO_OWNER(Owner_Id) reference

    Hi All,
    We are getting below fatal error while repairing the repository. and we are using MDM SP07 Patch Level 27.
    Error Message: $$$ Non-fatal error (1202): Foreign Key u2018FCM_1_CO_OWNER(Owner_Id) referencing A2i_CM_Users (UserId)u2019 is missing.
    Can  anyone help me how to resolve this issue ?
    Thanks & Regards,
    Mahesh

    Hello,
    I guess you have upgraded your system and hence you are getting this error.
    I guess some lookup table are missing the reference in this.
    But the error says NON-FATAL, please check if you are getting the same error while checking the repository.
    My suggestion would be to unmount and mount the reposiory again.
    regards,
    Abhishek

  • Primary key when creating reports with forms

    I'm new to APEX and I'm creating a report with forms using the wizard. I've checked the 'Include Analysis Pages' checkbox. When I select the 'add pages' button I get the following message:
    Table has no primary keys defined. A primary key is required when creating reports with forms.
    I know that the table does have a primary key because I defined it and also it is visible in the Sql workshop / Object browser and Toad.
    Am I missing something or is this some sort of bug?
    thanks
    sb

    You're missing something. This message means you've not told APEX what the primary key is. You shouldn't have been able to get passed the page in the wizard that asks for it though. Can't describe where it prompts for it from memory, but it shouldn't be hard to find.
    HTH
    Chris.

  • Unable to see Australia regions when creating a VM

    Hi,
    I can see Australia East and SouthEast when creating a new website, but cannot see these regions when selecting a new VM. 
    My billing address is set to New Zealand, and I have a colleague who also has an account but doesnt have this problem. 
    Any one got any ideas on what could be going on? I have also tried accessing the new portal, and get the same issue.
    Winston

    Hi Winston,
    Which image did you select when creating the VM? Did you colleague have the same kind of subscription as yours?
    I checked on my subscriptions and found that it seems that the Australia regiosn are not available for the MSDN subscription when creating an Azure VM. You can check your subscription. In addition, please make sure that you selected "create a new cloud
    service" when you create the new VM.
    Best regards,
    Susie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Unable to upload txt file when creating new message

    Hi Expert,
    We installed SolMan 7.1, but we are not able to upload txt file when
    create a new message, detailed steps as below:
    1. Click on “New
      Message” under “Common Tasks” in the left side
    2. Click on
      “Attachment” under “Create Message”
    3. Click on “Add”
      under “Attachment”
    4. Select file and
      click on “OK”
    5. But as the result, it says “No attachments. Select Add to
      upload a new attachment.”
    Could you please help advise the reason and solution?
    BR
    Takashi

    Hi Vikram,
    Thanks for your reply.
    I have tried again and found that, it seems if the file size is 0, it can't be uploaed; if the size if bigger than 0, then it can be uploaded.
    So I close this discussion now. Thank you!
    BR
    Takashi

  • Problem with a primary key when creating a new record in Forms

    My table has a field - MDD_KEY - that is a primary key. It is updated from a sequence with a before-insert database trigger. I know this works properly as the primary key was accurately populated when I inserted 1433 records.
    In Forms 6, I have a form based on that table. I have set the mdd_key as a hidden field because I assume it will be entered by the before-insert trigger. However, when I enter data into the table, and then try to save it, I get a FRM-40202: Field must be entered. - followed by - FRM-40222: Disabled item MDD_KEY failed validation.
    If I set DATA Required to no, when I try to save I get an FRM-40600: Record has already been inserted - but no such record exists in the database. I know this record is unique and does NOT exist because I deliberately made it up.
    In the property palatte, the attributes of the field are:
    DATA Data Type Number
    Required Yes
    DATABASE Database Item Yes
    Primary Key Yes
    Query Only No
    Query Allowed Yes
    Query Length 0
    Insert Allowed Yes
    Update Allowed Yes
    Update Only if Null No
    Lock Record No
    I assume that my problem is that with a new record, the form wants to see the MDD_KEY populated before it saves - but that isn't going to happen until the before insert trigger fires in the database. I assume I have to populate that field within forms, but how do I do that without messing up the database trigger/sequence? I will have to load more data directly into the database - so I need the database trigger in place.
    I have not used primary keys before so I am more than a little bit confused about how and when it should be populated when a new record is created in Forms.
    Any help would be appreciated as I cannot enter new data into my form (works well with existing data).
    Thanks
    Glenn

    hi
    if u have any problem using seq then try that statemetn ur block level in ur form
    PRE-INSERT trigger
    select nvl(max(nvl(srno,0)),0)+1 into :srno from tablename;
    Rizwan

  • How do I choose an image when creating or updating a Contact?

    Hey All,
    I just upgraded to Mountain Lion and I'm converting all of my contacts (from various accounts) to use the iCloud service, and all is going very well except for one small thing.  When I either update or create a new contact via the Contacts application, I cannot choose a custom image to associate with a contact.  The application only allows me to choose from a list of "Defaults", "Recently Used" or allows me to take a picture from my computer's camera.  It seems odd that I can't simply select any image from my hard drive (or from iPhoto), but maybe I haven't set something up correctly.
    The web interface for iCloud allows me to select a custom image from my hard drive so I have a work around, but its a bit clunky to do a lot of them.
    Anyone else having this problem?
    Thanks!!!

    When you're in the contact photo edit screen, in the bottom right there is another edit button, click that and drag and drop the desired image in there, scale it as desired, save.

  • Unable to set up Kerberos when creating Open Directory Master-beginner!

    I'm trying to promote a standalone server to an Open Directory master.
    In the Kerberos section I am typing my FQDN into the Realm field
    which is studioserver.example.com.
    However the searchbase is already filled with dc=studioserver,dc=local
    I've tried every different permutation but when I save the settings, the overview shows that Kerberos is stopped and therefore no KDC is created.
    I've used Lookup to confirm that DNS is ok...could this still be the problem?
    Any help much appreciated.

    Hi
    If DNS is configured correctly then the Kerberos Realm and search base fields will be both filled in automatically. The only difficult you have to do is decide on the Directory Administrator name and password and click OK.
    The only way out of this is to demote back to Standalone. This will trash the LDAP configuration and database effectively allowing you to start again. Export any users and groups first. Home folders (if you have created any) will not be affected.
    Go back and stop the DNS Service and delete the configuration you have in there, stop any other service you have running as well as deleting any configuration that depends on DNS. If you have configured DHCP, stop this and delete the configuration. Restart the server. Start simple file services first, AFP etc and then move onto DNS. Make sure this is resolving correctly. Avoid .local.
    Follow the instructions given in the first thread.
    You could also download the Open Directory Administration Manual from here:
    http://www.apple.com/support/manuals/macosxserver/
    Tony

  • Choosing default currency when creating an EPMA application

    Good morning everyone,
    I have to create a new EPMA application. In the early steps of the Application Creation Wizard you have to choose the default currency from a dropdown list, but the currency I need is not listed in it.
    Is there any way to add a new currency to that dropdown list?
    Thank you.
    Regards,
    G.S.Feliu

    Hi,
    NO U cannot have it since Currency in sales is in Sales Org which is missing in yr config.
    U need to enter it manually.
    Regards
    Krishna

Maybe you are looking for

  • How to reset EFI password ??

    i got stuck on efi password . how to reset and can i update my os without efi password ??

  • I tunes for windows 98 SE

    Is there any i tunes software i can run my i pod on for windows 98 Second edtion thank u. Mr d roberts

  • Compact Storage

    I'm trying to run the Compact Storage utility in order to reclaim space since I've hit the Oracle XE size limit. I clicked the Compact Storage link, and the page displayed "A job to compact storage has been submitted" but nothing appears to have actu

  • System NSP client 001 has no logical name!

    HI all.Im install SapNetWeaverSneakPreviewABAP. -client copy (txn SCC4) into say 001 -log on to 001 with **** and pass transaction SCCL source client 000 and target client 001. -now run transaction RSA1 for initial bw setup AND SAP output System NSP

  • Update Lightroom 4.2

    Ist das Update auf Lightroom 4.2 auch in deutscher Sprache erhältlich?