problem with creating

Hello

I created the table below.
-- Create table
create table RC_ANNEX_CODE
(
  CODE_ID         NUMBER(8),
  ANNEX_ID        NUMBER(8) not null,
  FORM_TYPE       VARCHAR2(50),
  ANNEX_FORM_CODE VARCHAR2(50) not null,
  ANNEX_CODE_DESC VARCHAR2(200)
)
tablespace TS_IRS
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
-- Create/Recreate primary, unique and foreign key constraints 
alter table RC_ANNEX_CODE
  add constraint PK_RC_ANNEX_FORM_CODE primary key (ANNEX_FORM_CODE)
  using index 
  tablespace TS_IRS
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
After you have created the table below
create table RCI_annex_code
(
  I_ANNEX_FORM_CODE_ID VARCHAR2(50) NOT NULL,
  I_ANNEX_FORM_CODE    VARCHAR2(50),
  ANNEX_FORM_CODE_ID   NUMBER(8)
)
tablespace TS_IRS
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
-- Create/Recreate primary, unique and foreign key constraints 
alter table RCI_annex_code
  add constraint PK_RCI_annex_code_ID primary key (I_ANNEX_FORM_CODE_ID)
  using index 
  tablespace TS_IRS
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
When I create constraints, it gives me an error:-ORA-02270: no unique or primary key corresponding to this column list
alter table RCI_annex_code
  add constraint FK_RCI_annex_code foreign key (ANNEX_FORM_CODE_ID)
  references rc_annex_code (code_ID);
It gives an error for the altar above, kindly help

If the parent key is really rc_annex_code.code_id, and the pharmacokinetics of the rc_annex_code is really annex_form_code, and then rc_annex_code.code_id make it unique:

create table rc_annex_code
( code_id              number(8) constraint uk_rc_annex_form_code unique
, annex_id             number(8) not null
, form_type            varchar2(50)
, annex_form_code      varchar2(50) not null constraint pk_rc_annex_form_code primary key
, annex_code_desc      varchar2(200) )
tablespace ts_irs;

create table rci_annex_code
( i_annex_form_code_id not null
                       constraint pk_rci_annex_code_id primary key
                       constraint fk_rci_annex_code references rc_annex_code (code_id)
, i_annex_form_code    varchar2(50)
, annex_form_code_id   number(8) )
tablespace ts_irs;

Note that it is often a good idea NOT to specify the data type for the columns of the FK and rather define the constraint so he can inherit from the parent.

It's also a common convention to put the PK columns first in the table definition - it is a bit confused in your example, because code_id is listed first but isn't the PK. That they mix? I noticed that you have defined rci_annex_code.i_annex_form_code_id as varchar2 (50) (as annex_form_code.annex_form_code), but then you try to reference rc_annex_code.code_id, which is number (8). I wonder if you meant rc_annex_code.code_id to be the PK in the first place, that is to say:

create table rc_annex_code
( code_id              number(8) not null constraint pk_rc_annex_form_code primary key
, annex_id             number(8) not null
, form_type            varchar2(50)
, annex_form_code      varchar2(50) constraint uk_rc_annex_form_code unique
, annex_code_desc      varchar2(200) )
tablespace ts_irs;

create table rci_annex_code
( i_annex_form_code_id not null
                       constraint pk_rci_annex_code_id primary key
                       constraint fk_rci_annex_code references rc_annex_code (code_id)
, i_annex_form_code    varchar2(50)
, annex_form_code_id   number(8) )
tablespace ts_irs;

The whole ' Code ' / ' ID ' naming system is a little confusing so, normally, a code is just a kind of code. You have 'Code' and 'ID' in both table names and column names, with 'annex_form_code' in the 'annex_form_code_id' in the child and parent.

Tags: Database

Similar Questions

  • Problem with create table as select (DEC)

    Hello

    We try to data cleaning of huge tables. And a customer of guise is reanme main table to the backup table. Then create a master table in select * backup table with some test.

    Now the problem with create table select, is that it creates the table without indexes and constraints. Is it possible to use the ETG (create the select table) with the same structure that he was the (all index, constriaints).

    Or any other solution to solve this problem?

    Thanks in advance

    Sweety wrote:
    Hello

    We try to data cleaning of huge tables. And a customer of guise is reanme main table to the backup table. Then create a master table in select * backup table with some test.

    Now the problem with create table select, is that it creates the table without indexes and constraints. Is it possible to use the ETG (create the select table) with the same structure that he was the (all index, constriaints).

    Or any other solution to solve this problem?

    Thanks in advance

    No, this is not possible. You need to get the manuscript of dependent object and create it manually.

  • Problem with creating, truncating and deleting a database in 1 transaction

    Hello

    I came across a problem when it is in the same transaction creating a data base, truncating it and then delete it. Do these 3 things causes the following transaction validation to last forever.
    The following code causes the problem:

    File envHome = new File ("truncate-delete-test");
    envHome.mkdirs ();
    EnvironmentConfig envConfig = EnvironmentConfig.DEFAULT;
    envConfig.setAllowCreate (true);
    envConfig.setTransactional (true);
    envConfig.setTxnSerializableIsolation (true);
    Environment = environment (this.envHome, envConfig);

    Transaction txn = this.environment.beginTransaction (null, TransactionConfig.DEFAULT);

    DbConfig DatabaseConfig = new DatabaseConfig();
    dbConfig.setAllowCreate (true);
    dbConfig.setTransactional (true);
    String dbName = "test-db";
    Database db = this.environment.openDatabase (txn, dbName, dbConfig);

    CBI Close();
    environment.truncateDatabase (txn, dbName, false);
    DB = this.environment.openDatabase (txn, dbName, dbConfig);

    CBI Close();
    this.environment.removeDatabase (txn, dbName);

    TXN.Commit (); <-this statement would never return.

    I encountered this problem with version 4.0.92. I've updated to 4.1.7 but the problem still exists.
    Also, it manifests when the records are written to the database before and after it truncate.

    Looking in the process with the debugger shows the following stack trace during the commit endless happens:

    [...]
    DbTree.deleteMapLN (DatabaseId) line: 1069
    DatabaseImpl.finishDeleteProcessing (line): 1164
    Txn.cleanupDatabaseImpls (boolean) line: 1404
    TXN.Commit (durability) line: 728
    TXN.Commit (line): 549
    Transaction.Commit (line): 227
    [...]

    Depending on where I stop the process, there are additional calls on top of the stack.

    Exit Registration unfortunately does not help here, as the log messages stopped once the problem started to appear.

    Is it somehow not allowed to create, truncate and delete a database in the same transaction? I couldn't find anything in this sense in the documentation, and it is no exception either.
    Or have I came across a bug in I here?

    Thanks in advance for any advice or solutions.

    Christoph
  • Problem with creating a sequence

    Hello

    I'm having a problem with a sequence that I am creating. Basically, I'm trying to create a sequence with a default value based on the value in another table, i.e.
    CREATE SEQUENCE seq
    START WITH (
                min(customer_id) from customer
                )
    INCREMENT BY 1;
    Is this possible? I get errors.

    You can use dynamic sql or, if you use SQL * more take advantage of substitution variables:

    SQL> DROP SEQUENCE seq
      2  /
    DROP SEQUENCE seq
                  *
    ERROR at line 1:
    ORA-02289: sequence does not exist
    
    SQL> DECLARE
      2      stmt VARCHAR2(1000);
      3  BEGIN
      4       SELECT  'CREATE SEQUENCE seq START WITH ' || min(empno)
      5         INTO  stmt
      6         FROM  emp;
      7       EXECUTE IMMEDIATE stmt;
      8  END;
      9  /
    
    PL/SQL procedure successfully completed.
    
    SQL> SELECT seq.NEXTVAL FROM dual
      2  /
    
       NEXTVAL
    ----------
          7369
    
    SQL> DROP SEQUENCE seq
      2  /
    
    Sequence dropped.
    
    SQL> COLUMN s NEW_VALUE s NOPRINT
    SQL> SELECT  min(empno) s
      2    FROM  emp
      3  /
    
    SQL> CREATE SEQUENCE seq START WITH &s;
    old   1: CREATE SEQUENCE seq START WITH &s
    new   1: CREATE SEQUENCE seq START WITH       7369
    
    Sequence created.
    
    SQL> SELECT seq.NEXTVAL FROM dual
      2  /
    
       NEXTVAL
    ----------
          7369
    
    SQL> 
    

    SY.

  • Problem with creating a new line in widget glossary

    I use 6 Captivate and have a problem with trying to display text on a new line in the description field of the widget glossary. In playback mode, a carriage return displays form \n

    I read in another discussion (from early last year), that this problem had been resolved and that the fix would be communicated soon on the blog of captivate for users without a subscription. Anyone know if the fix has been shared yet - I can't find it anywhere?

    Thanks for any help you can provide.

    Tenneil

    Hi Tenneil,

    Greetings from Adobe.

    Please click on the link below and download the Interaction of Glosarry updated.

    https://files.Acrobat.com/a/preview/0a17bb28-049e-4AC7-b8f7-dbdacef5e91c

    1. Extract the zip to your desktop.
    2. Copy "08_Glossary.wdgt" into the extracted zip file.
    3. Go to: C:\Program Files (x 86) \Adobe\Adobe Captivate 6 (32 bit) \Gallery\Interactions (for 32-bit Captivate) or C:\Program Files\Adobe\Adobe Captivate 6 (64-bit) \Gallery\Interactions (for 64-bit Captivate).
    4. Replace the glossary widget in the record of the interaction. Restart the Captivate 6. (Make sure you take the backup of the original Glosarry Widget)
    5. Ask the widget again and check the issue.

    Let me know if it works for you.

    Kind regards

    MILIN

  • Problems with creating an image mask!

    I have problems with the creation of an image mask. I tried jpg and psd as alpha channel (black and white), but it seems that there is a bug. I also tried a mask "trace" (or whatever it is called in English - I use the German version) but it doesn't work either. Someone has any idea how to solve this problem? Thanks in advance

    You can use JPEG, just set it to Luma Matte. Make sure the mask is white pure for a clean mat.

    If its black set the market back.

  • ORA-29855 problem with creating an index

    Hi all,

    I am trying to create an index, but I have this problem:

    SQL > CREATE INDEX ITALIA_NODE_IDX ON ITALIA_NODE$ (GEOMETRY) INDEXTYPE IS MDSYS. SPATIAL_INDEX;
    CREATE INDEX ITALIA_NODE_IDX ON ITALIA_NODE$ (GEOMETRY) INDEXTYPE IS MDSYS. SPATIAL_INDEX
    *
    ERROR on line 1:
    ORA-29855: an error has occurred in the execution of routine ODCIINDEXCREATE
    ORA-13249: internal error in the Spatial index: [mdidxrbd]
    ORA-13249: error in the Spatial index: index build failed
    ORA-13249: error in the spatial index: [mdrcrtxfergm]
    ORA-13249: error in the spatial index: [mdpridxtxfergm]
    ORA-29400: data cartridge error
    ORA-01653: unable to extend table M2_10A70$ $.1024 by SPACE in tablespace USERS
    ORA-06512: a 'MDSYS. SDO_INDEX_METHOD_10I', line 10


    What do you think of this problem?
    Thank you in advance.
    Crystal

    Published by: crystal13 on June-18-2010 2.03

    Hello

    It looks like your USERS tablespace is small. You have no space left. Expand the size of the storage space by enlarging the file below or put a second to her, or put the tablespace mode AUTOEXTEND. See the guide administrators: http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/tspaces.htm#i1010516

  • Problems with creating an exe file

    Hello

    I'm trying to convert a vi to an executable. When I run the constructor it comes up with an error:

    Visit ni.com/ask support request page to learn more about the resolution of this problem. Use the following as a reference:

    Error 8 has occurred to create a folder to create a directory Recursive.vi-> AB_Destination.lvclass:Create_Destination.vi-> AB_Build.lvclass:Create_Destinations.vi-> AB_Application.lvclass:Create_Destinations.vi-> AB_Build.lvclass:Build.vi-> AB_Application.lvclass:Build.vi-> AB_EXE.lvclass:Build.vi-> AB_Engine_Build.vi-> AB_Build_Invoke.vi-> AB_Build_Invoke.vi.ProxyCaller

    Possible reasons:

    LabVIEW: File permission error. You do not have the correct permissions for the file.

    C:\Users\builds

    I can't understand the permissions that he speaks. I even changed my program a public folder.

    Thank you

    In the build settings, you said to save the generation to a public folder?

  • A good difficulty for problems with creating an account ePrint Center.

    Problem: impossible to register with ePrint Center

    Difficulty: The problem you are having is probably due to an old Snapfish account registered to your email address. ePrintCenter and Snapfish account information is stored in the same place and I saw this before conflict.

    You will need to go to http://www.snapfish.com/snapfish/welcome, click on "Sign In" in the upper right corner of the page and then click on the 'forgotten password' link and enter the email address that is causing your problems, you should receive an email from Snapfish, which allows you to create a new password. Once you have created a new password for Snapfish, try to Sign In on ePrintCenter (http://www.eprintcenter.com) using your email address and the password you created for Snapfish.

    If you have any other questions do not forget and let us know. We're here to help.

    If I have SOLVED your problem, please do not hesitate to provide LAURELS and make sure that you mark this thread as a SOLUTION OFFERED!

    Although I work for HP, my messages and responses are my own opinion and not of HP.

    In addition, if the fix above does not seem to solve the problem or if you are unsure if you have a Snapfish (http://www.snapfish.com) account, use the e-mail address you want to use with ePrint Center (http://www.eprintcenter.com) and then use the information that you created and try to "Sign In" or create an account on ePrint Center.

  • Problem with creating an image map

    I struggled to create a simple image with Dreamweaver CC map.

    I'm in Design view and have a simple flowchart that I would have on my site with each network diagram box with a link to an additional page with more depth on the subject content.

    If I click on the image in live view, the properties toolbar does not show the part of image map (see first image).

    Capture1.PNG

    However, if I click on the code from the image map controls appear (see the second image).

    Capture2.PNG

    Now, behold, where the question is...

    If I click on the rectangular selection tool in the map properties bar and then try to select the portion of the image to have a point of access/link; the part of the map of the toolbar disappears and returns to the appearance of the first view?

    Therefore, I can't make a selection or create the HotSpot...?

    Please help with advice you may have.

    The site is responsive, and I decided to recreate this image as an SVG, so that it can scale - with a sensitive site, but I just want to experiment with the layout before generating the final graph.

    Thanks for any help you may have!

    Problem is that you are in LIVE view mode.  Switch to DESIGN view for working with image maps.

    What happened to the use of SVG for your tree?

    Nancy O.

  • Problem with creating organization assignment

    Hi all

    I wanted to give permission to create the Organization to a role in OIM 11 g. Its cities on the link: http://docs.oracle.com/cd/E17904_01/doc.1111/e14316/role_mangmnt.htm

    the DIRECTORS of ORGANIZATION IDENTITY of IOM default role is the role that is used to grant this permission to any user. But the problem is that I can't find this default role in the roles of IOM. I don't have IDENTITY USERS ADMINISTRATORS but not for organizations. Can someone ' a please guide me as to what exactly am I missing here?

    Thank you
    $id

    Try again with the role of OPERATOR

    To customize permissions, click on the link given in my post above

  • problems with creating a subpage template

    Hello

    I have a question and would appreciate your help please.

    I created a model with common elements of my pages, including global navigation header and footer, when I try to create a subpage of the template and save it in a different folder as index.php one image now appears in the new index.php file.what should I do to solve this problem, thank you.

    loopy22

    Well the lem prob here is that you have a path relative to the document on this image:

    images/emusicdownloadslogo.gif"
    
    change it to root-relative:
    
    /images/emusicdownloadslogo.gif"
    
    and you'll be good to go.
    
    However, you had said that this page was created as a Child of a DW Template, however this page has no such code.
    
    It was not created as a Child page of a DW Template.  So not sure why you think it is.  Perhaps you mean thatyou copied a page you are calling a "template" in one folder and pasted that code into a new page in another folder?
    
    -- 
    
    E. Michael Brandt
    
    www.divahtml.comwww.divahtml.com/products/scripts_dreamweaver_extensions.phpStandards-compliant scripts and Dreamweaver Extensions
    
    www.valleywebdesigns.com/vwd_Vdw.aspJustSo PictureWindowJustSo PhotoAlbum, et alia
    
    --
    
  • Problem with creating a container with the single line of text

    Hi ~
    I'm overwhelmed with a following problem.
    Problem: I need to create a container with a single line of text. As I learn from the TLF API, there is no way to do that so he left only in a way that looks like this:

    Assuming that textFlow object is to create
    var container: Sprite = new Sprite();
    var width: Number = 500; It has specified the value
    var height: Number = 300; just estimate is sufficient for a normal line height
    var controller: DisplayObjectContainerController = new DisplayObjectContainerController (container, width, height);
    controller.verticalScrollPolicy = ScrollPolicy.OFF;

    textFlow.flowComposer.addController (controller); textFlow.flowComposer.composeContainer (textFlow.flowComposer.getControllerIndex (controlled r));

    find the first line of the top in the created container
    var textFlowLine:TextFlowLine = textFlow.flowComposer.findLineAtPosition (controller.absoluteStart, false);
    var calLineHeight:Number = textFlowLine.textHeight + 8; 8 this is just a test value
    controller.setCompositionSize (width, calLineHeight);
    textFlow.flowComposer.updateContainer (_textFlow.flowComposer.getControllerIndex (Controller));


    In this way, she first calculate first line height giving enough space for the controller
    and cope, after that there adjust the height of the container again and then updates.
    It's so fresh generals I guess

    If anyone has more simple or just how?

    In regards to a single line. I think you can set the lineBreak on the TextFlow to "explicit". In this case lines only break to return to the line and the point ends.

    If you want to be changed, take a look at the TextLineFactory APIs. NaN set in the width/height of the limit and it gets filled. It is a more lightweight way to create TextLines.

    Take a look at the properties DisplayObjectContainerControllers compositionWidth and compositionHeight full TextFlows as in your code using. You still want to use explicit line breaks.

    Hope that helps!
    Richard

  • I have a problem with creating a Xbox account.

    Original title: creating an Xbox account

    I tried to make an Xbox Live account, so I can use my Xbox music app. Yet, whenever I'm almost done with the Xbox account-creation-process told me to create a Windows Live account, and then come back to xbox.com. Since I already have an I sign in and then return to xbox.com. But Xbox told me always to create an account! I went through this process of signature on my account at least 15 times. What should I do to correct that?

    Hello again,

    Looks like you need to get Xbox support to get this configuration for you. Here is a link:

    http://www.Xbox.com/en-us/forums

  • Problem with 'Create new Extrusion of the selected layer' CC 2014

    Hello, I am experienced with Photoshop but I'm new to 3D text in Photoshop.  I type the text and convert it to a form.  When I choose to create new Extrusion of the selected layer I get the dialog, I don't see in tutorials.  It says "you are about to create a 3D layer.  You want to switch to the 3D workspace?  Yes/No, do not display again. "Which one should I use for the 3D text?

    If I choose Yes, all the panels disappear and the content in the tool options bar (Ribbon?) just under the menu bar disappears.  I have to restart Photoshop to get back on the tool options.  What could I do it wrong?

    Thanks - Dave

    I just chose 'No' and don't look at back.  I love my workspace, just as it is and doesn't prefer Photoshop to change for me in this case especially.

    You bring up the 3D Panel yourself via the window - 3D.  I think it's a good alternative for the Actions Panel, because I don't have any currently working in the 3D world.

    You'll want to see easily if you are working on 3D are 3D Panel and panel properties, among a few others.

    Regarding return your workspace as you like it...  Note the small switch near the upper right of the main window of Photoshop.  That can be used to select a workspace.  I suggest that you experiment and familiarize yourself with the concept of workspaces.  You can set your own and save it with a name, and that can really be useful.

    -Christmas

  • Problem with creating a folder

    Hello guys,.

    I wrote this code

    
    
    var myWindow = new Window ("dialog","Laredoute Strukturskapare");
    myWindow.orientation = "column";
    
    myWindow.add ("statictext", undefined, "write a number (example:342344)");
    var Jobnr = myWindow.add ("edittext", undefined, "");
    Jobnr.active = true;
    Jobnr.characters =40;
    
    
    
    myWindow.add ("button", undefined, "OK");
    myWindow.add ("button", undefined, "Avbryt");
    
    
    new Folder("/xxxx/xxx/xxx/" + Jobnr+ "/testcreatefolder").create(); ;   
    
    myWindow.show ();
    
    
    
    
    
    

    the problem is, the script creates a file on the location, but the name of the folder is "[EditText object]"

    Could someone help me fix the code?

    Thanks in advance

    Try this.

    var myWindow = new Window ("dialog","Laredoute Strukturskapare");
    myWindow.orientation = "column"; 
    
    myWindow.add ("statictext", undefined, "write a number (example:342344)");
    var Jobnr = myWindow.add ("edittext", undefined, "");
    Jobnr.active = true;
    Jobnr.characters =40; 
    
    var ok = myWindow.add ("button", undefined, "OK");
    ok.onClick = function ()
    {
            new Folder("/xxxx/xxx/xxx/" + Jobnr.text+ "/testcreatefolder").create();
            myWindow.close();
        }
    var Avbryt = myWindow.add ("button", undefined, "Avbryt");
    Avbryt.onClick = function ()
    {
            myWindow.close();
        }
    myWindow.show ();
    

    Kind regards

    Cognet

Maybe you are looking for

  • Equium A60 - failure of resume and press a key to continue

    HelloI have an Equium A60 which is coming up with 'failed to resume and Press any key to continue' when I turn it on. This FAILED after the battery is and it stop. By pressing a button any does nothing. I can't enter the BIOS if I'm fast until the me

  • Satellite A100 - 906 internal LCD does not work

    Hello, I have laptop Toshiba Satellite A100-906, and I struggle with internal LCD. Only three gray belts are displayed with horizontal lines or without. Backligt works. External monitor works.Initially, the screen freezes sometimes but after short ti

  • SMC100 LabVIEW drivers are considered to be "mark Points.

    Hi all I try to install the SMC100 device drivers The pilots of the SMC100 controller has been developed under LABVIEW 6.1. So I installed LABVIEW 6.1 also. runtime engine. I installed the drivers (in the link below) in the file "instr.lib" as requir

  • Windows install Service Pack 3

    A long time ago when I received the automatic update to Service Pack 3 and tried to install it, the update failed (Error 1706: file PRORET.) MSI not found).  I do not have the disk that he wanted me to insert to find the file and my attempts to find

  • Default password for the HP Laserjet 1536dnf printer?

    I am not able to access the network on my 1536dnf printer menu. I wonder a password which I don't remember even to have fixed. Could you please help me to get a new password so I can get access to the menus on my printer? Thank you very much in advan