Creating Foreign tables

Hi Everyone,
What is Foreign table? Can any one of you please tell me how to create foreign table, please suggest me with an example.
Helpful answers will be rewarded immediately.
Thanks & Regards,
Venkat.

To give you the steps for creating table:.
There are two approach in creating a table.
1. Bottom-up approach
2. Top-down approach. 
Both are valid and you can choose which approach is suitable for you.  I always use the bottom-up approach. Here are the steps to create the tables with this approach.
1. SE11 will take you to the DDIC and enter the name of the new table to be created. Let us say Zname. Click create.
2. Enter the short discription of the table and enter the field of the table.  If it is primary key and you have to check the box. 
3. Enter the data element  and double click it, you will be asked to save and will take you to data element discription page.  Enter the short discription of the data element and enter the information of domain like the length of field and type of field.
4. If you wanted to use the existing domain then its fine, or else, you have to create one.  Enter the domain name in the data element page and double click it.  Page will ask to save and jump to domain creation page.
5. In the domain page, you have to save the information which you have already given in the data elements page and check it.  Before going to data element page, you have to activate the domain.
6. Go to data element page and save, check and activate.
7. Go to main table page and save, check, and activate.  
8. Also, you have to save the technical settings of the table.
The table is now ready for operation. You can use it in your program or you can use it to enter information.
Check table:  It is the table which will have all the information about the Foreign keys which are the primary keys in the check table.
<b>It can be created by creating the foreign key from the main table.  Click foreign key in the main table and it will take you to a page which will ask for table name and field to which foreign key relation has to be associated. Enter the information and you can create the check table automatically</b>.
SM30 is used for maintenance of the table, that is to realease the errors occured during the creation of the table.  
Rewar  points  if it is usefull 
Girish

Similar Messages

  • Is it possible to create foreign key from composite key in other table.

    SQL> desc PRODUCT_CONFIG_OPTION;
    Name Null? Type
    CONFIG_ITEM_ID NOT NULL VARCHAR2(20) --composite primary key
    CONFIG_OPTION_ID NOT NULL VARCHAR2(20) --composite primary key
    CONFIG_OPTION_NAME VARCHAR2(100)
    DESCRIPTION VARCHAR2(255)
    SEQUENCE_NUM NUMBER(18)
    LAST_UPDATED_STAMP TIMESTAMP(6)
    LAST_UPDATED_TX_STAMP TIMESTAMP(6)
    CREATED_STAMP TIMESTAMP(6)
    CREATED_TX_STAMP TIMESTAMP(6)
    SQL> DESC PRODUCT_CONFIG_ITEM;
    Name Null? Type
    CONFIG_ITEM_ID NOT NULL VARCHAR2(20)
    CONFIG_ITEM_TYPE_ID VARCHAR2(20)
    CONFIG_ITEM_NAME VARCHAR2(100)
    DESCRIPTION VARCHAR2(255)
    LONG_DESCRIPTION CLOB
    IMAGE_URL VARCHAR2(255)
    LAST_UPDATED_STAMP TIMESTAMP(6)
    LAST_UPDATED_TX_STAMP TIMESTAMP(6)
    CREATED_STAMP TIMESTAMP(6)
    CREATED_TX_STAMP TIMESTAMP(6)
    SQL> desc product;
    Name Null? Type
    PRODUCT_ID NOT NULL VARCHAR2(20)
    PRODUCT_TYPE_ID VARCHAR2(20)
    PRIMARY_PRODUCT_CATEGORY_ID VARCHAR2(20)
    MANUFACTURER_PARTY_ID VARCHAR2(20)
    FACILITY_ID VARCHAR2(20)
    INTRODUCTION_DATE TIMESTAMP(6)
    SUPPORT_DISCONTINUATION_DATE TIMESTAMP(6)
    SALES_DISCONTINUATION_DATE TIMESTAMP(6)
    SALES_DISC_WHEN_NOT_AVAIL CHAR(1)
    INTERNAL_NAME VARCHAR2(255)
    BRAND_NAME VARCHAR2(100)
    COMMENTS VARCHAR2(255)
    =========
    CREATE TABLE PROD_CONFIG_PROD_CONFIG_OPTION (
    PRODUCT_ID VARCHAR2(20),
    CONFIG_ITEM_ID VARCHAR2(20),
    CONFIG_OPTION_ID VARCHAR2(20),
    PAGE_NUM_TO NUMBER(18),
    ALTERNATE_PAGE_NUM_TO1 NUMBER(18),
    ALTERNATE_PAGE_NUM_TO2 NUMBER(18),
    ALTERNATE_PAGE_NUM_TO3 NUMBER(18),
    LAST_UPDATED_STAMP TIMESTAMP(6),
    LAST_UPDATED_TX_STAMP TIMESTAMP(6),
    CREATED_STAMP TIMESTAMP(6),
    CREATED_TX_STAMP TIMESTAMP(6),
    CONSTRAINT PK_PROD_CAT_CONFIG_MOD PRIMARY KEY (PRODUCT_ID),
    CONSTRAINT FK_PRODUCT_ID FOREIGN KEY (PRODUCT_ID) REFERENCES PRODUCT(PRODUCT_ID),
    CONSTRAINT FK_CONFIG_ITEM_ID FOREIGN KEY (CONFIG_ITEM_ID) REFERENCES PRODUCT_CONFIG_ITEM(CONFIG_ITEM_ID),
    CONSTRAINT FK_CONFIG_OPTION_ID FOREIGN KEY (CONFIG_OPTION_ID) REFERENCES PRODUCT_CONFIG_OPTION(CONFIG_OPTION_ID) )
    TABLESPACE DATA_SMALL
    i try to create this table if i omit 3rd foreign key constraint then table successfully created.but including trd foreign key constraint it return error "ORA-02270: no matching unique or primary key for this column-list"
    i checked everything is it possible to create foreign key from composite key in other table.

    And
    CONSTRAINT FK_CONFIG_OPTION_ID FOREIGN KEY (CONFIG_ITEM_ID,CONFIG_OPTION_ID) REFERENCES PRODUCT_CONFIG_OPTION(CONFIG_ITEM_ID,CONFIG_OPTION_ID)
    ?

  • How to create transaction table in R/3

    Hi Gurus,
                  I have created master data table in R/3 with zempid as a primary key. I need to create transaction table for employee and visitor. how can i relate 2 transaction table with employee master table while creating tables in R/3 SE11.
    Notes: both employee and visitor transaction table has zempid.
    please let me know how to create table with relations.
    Thanks & Regards,
    Bharath

    Hi,
    In a normal database (say Oracle), this referential integrity is taken care of by PK-FK (primary key - foreign key) relationships. As far as OLTP - SAP R/3 is concerned, these are exisitng for the tables defined by SAP.
    Speaking about BW:
    1. You will bring master data from R/3--> BW first (its always a good practice), which should mean that empid 1000 - 1007 will flow to BW. Also your OLTP system ensures that there can be no transaction data (due to PK-FK relationships), for any emp. id other than 1000-1007.
    2. There could be another case that when the master data has been transferred to BW, due to time lag, in between master data and transaction data are created in R/3... meaning thereby that R/3 now has both master data about say emp.Id 1008 and transaction data as well.
    3. Now the transaction data is extracted from R/3, which will bring the transaction data for 1008, eventhough the master data for 1008 (loaded in step 1) has not come down to BW.
    4. Such situation can be controlled in BW, there are options wherein you can control this. the options are:
      - Load data even if there is no master data (this will create master data record with key values and nulls in other attributes) - record for 1008 will get loaded in such cases.
    - Do not Load data when there is no master data - The record with 1008 emp. id will not be loaded in such a case.
    Hope this helps.
    Cheers,
    Sumit

  • HOW TO CREATE A TABLE WITH 800 COLUMNS?

    I have to create a table with 800 columns.I know the create statement to create a table but it will take more time.
    So tell me the other method.

    If you really think that you have to store 800 values for a given entity, it would be a wise idea if you store you information in columnar fashion. Make a main table and a attribute table, keep the primary identifier in the  main table and store other attributes in the attribute table where you can keep the primary key of the first table as foreign key (not necessary) to maintain the relationship.
    eg.
    emp_id
    emp_name
    dob
    city
    state
    country
    pincode
    1
    Mr X
    01/01/1990
    ABC
    ZXC
    MMM
    12345
    Can be stored as
    Main Table
    emp_id
    emp_name
    1
    Mr X
    Attribute Table
    attr_id
    emp_id
    attr_nam
    attr_value
    1
    1
    dob
    01/01/1990
    2
    1
    city
    ABC
    3
    1
    state
    ZXC
    4
    1
    country
    MMM
    5
    1
    pincode
    12345
    Creating table with large number of columns is bad design as suggested by other Gurus.
    Thanks

  • Doubt on creating logical table in BMM

    I have a fact table (time fact table) in physical layer. I am adding a new column billable flag.
    This flag is related with w_lov_d table that means it will contain the row wid of W_LOV_D in time fact table.
    I have created a physical alias table(W_LOV_D) and created foreign key relation to time fact table.
    I have created logical dimension table for billable flag in logical table. WHen i create this table, content tab should be at the table itself. I am getting all the table which are listed in the content. But not the table itself.
    How can i bring the table itself in Logical dimension table and
    I didnot find the dimension table under content table of time fact table also.
    Can anyone throw some idea on this?..

    Just drag and drop the attribute from the physical layer to the logical dimension table. You will have the LTS created with the table as content.

  • Syntax for creating foreign key across users in a database

    There are two user present A,B.They are granted all privileges.Now in USER A, there is a table PARENT whose primary key is PARENT_NO.In USER B I have created a table CHILD whose primary key is CHILD_NO.
    In the CHILD table of USER B, I want to create a foreign key relation to the PARENT table of USER A.For this I have created a column CHILD_PARENT_NO in the CHILD table.If anybody knows the syntax please post the syntax for creating the required foreign key relationship?

    Please post your code. Cut'n'paste from SQL*Plus like this...
    SQL> conn a/a
    Connected.
    SQL> desc t1
    Name                                      Null?    Type
    COL1                                               NUMBER
    COL2                                               VARCHAR2(10)
    SQL> grant references on t1 to b;
    Grant succeeded.
    SQL> conn b/b
    SQL> create synonym a_t for a.t1;
    Synonym created.
    SQL> alter table test add constraint fk foreign key (n) references a_t(col1);
    Table altered.
    SQL> Note that Oracle will translate the synonym anyway...
    SQL> select constraint_name, r_owner, r_constraint_name
      2  from  user_constraints
      3  where table_name = 'TEST'
      4  /
    CONSTRAINT_NAME R_OWNER R_CONSTRAINT_NAME
    FK              A       T1_PK
    SQL> By the way, this ...
    GRANT ALL PRIVILEGES TO B;... is a mindbendingly unsafe way of proceeding. In real life you would have given user B the power to utterly destroy your database. It's always easier to start with good habits than to break bad ones so please get used to granting only the minimum set of privileges necessary.
    Cheers, APC

  • Unable to create foreign key: InvalidArgument=Value of '0' is not valid for 'index'. Parameter name: index

    I am running an SQL(CE) script to create a DB. All script commands succeed, but the DB get "broken" after creating the last costaint: after running the script, viewing table properties of Table2 and clicking on "Manage relations" gives the following error: Unable to create foreign key: InvalidArgument=Value of '0' is not valid for 'index'. Parameter name: index. Wondering what does that refer to...
    Here it is the script. Please note that no error is thrown by running the following queries (even from code that passing the queries by hand, one-by-one to sql server management studio).
    CREATE TABLE [table1] (
    [id_rubrica] numeric(18,0) NOT NULL
    , [id_campo] numeric(18,0) NOT NULL
    , [nome] nvarchar(100) NOT NULL
    GO
    ALTER TABLE [table1] ADD PRIMARY KEY ([id_rubrica],[id_campo]);
    GO
    CREATE UNIQUE INDEX [UQ__m_campi] ON [table1] ([id_campo] Asc);
    GO
    CREATE TABLE [table2] (
    [id_campo] numeric(18,0) NOT NULL
    , [valore] nvarchar(4000) NOT NULL
    GO
    ALTER TABLE [table2] ADD PRIMARY KEY ([id_campo],[valore]);
    GO
    ALTER TABLE [table2] ADD CONSTRAINT [campo_valoriFissi] FOREIGN KEY ([id_campo]) REFERENCES [table1]([id_campo]);
    GO
    Sid (MCP - http://www.sugata.eu)

    I know this is kind of old post, but did this realy solved your problem?
    I'm getting this same error message after adding a FK constraint via UI on VS2008 Server Explorer.
    I can add the constraint with no errors, but the constraint is not created on the DataSet wizard (strongly typed datasets on Win CE 6) and when I click "Manage Relations" on the "Table Properties" this error pop out:
    "InvalidArgument=Value or '0' is not valid for 'index'.
    Parameter name: index"
    Even after vreating my table with the relation in SQL the same occurs:
    CREATE TABLE pedidosRastreios (
        idPedidoRastreio INT NOT NULL IDENTITY PRIMARY KEY,
        idPedido INT NOT NULL CONSTRAINT FK_pedidosRastreios_pedidos REFERENCES pedidos(idPedido) ON DELETE CASCADE,
        codigo NVARCHAR(20) NOT NULL

  • Creating a table using SELECT

    I want to create a copy of an existing table. What is the proper SQL statement that will execute this?

    Note that constraints, indexes and triggers are not copied if you use this method. You will have to create statements to do that. A tool like TOAD makes it easy to do that.
    You can also use dbms_metadata package to create the table definition.
    SQL> SELECT DBMS_METADATA.GET_DDL('TABLE','EMP','SCOTT') FROM DUAL;
      CREATE TABLE "SCOTT"."EMP"
       (    "EMPNO" NUMBER(4,0),
            "ENAME" VARCHAR2(10),
            "JOB" VARCHAR2(9),
            "MGR" NUMBER(4,0),
            "HIREDATE" DATE,
            "SAL" NUMBER(7,2),
            "COMM" NUMBER(7,2),
            "DEPTNO" NUMBER(2,0),
             CONSTRAINT "PK_EMP" PRIMARY KEY ("EMPNO")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "SYSTEM"  ENABLE,
             CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO")
              REFERENCES "SCOTT"."DEPT" ("DEPTNO") ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "SYSTEM"

  • How to create a table inside a table in the dictionary

    I need to create a table in the dictionary that one of the components has to be a table.
    Someone known how to do it.
    Thanks.

    Hi
    U cannot create a table inside another table.
    The data storage is not supported in that manner.
    If you need multiple fileds based on a single line entry then , first figure out the relationships between these tables.
    Then create a second table with a part of the primary key as the first and a unquie primary key to be defined for adding all the rest of the entries in the second table.
    Also maintain the foreign key relationships between these tables.
    This is the way to have multiple entries for a single line of a table entry.
    Regards,
    Radhika.

  • Creating fact Table in ODI

    I just started working in ODI sometime back.
    But getting problem while creating a fact table.
    In datstore i am creating foreign keys(i.e Reference Key) for the fact table which have respective parent table and primary key.
    but after executing the interface foreign key is not being created in the database.
    Can anyone solve my problem for creating foreign key in fact table?
    thanks
    Gourisankar
    Edited by: user10220907 on Oct 15, 2008 9:31 PM

    Hi
    My target Dimension:T_Comapany where Comp_SKEY is a Surrogate key which is mapped to a sequence.
    My Fact Table :T_Fact_Sales where Company_Key is a column
    My requirement is to map the T_Comapany.Comp_SKEY(Surrogate Key) to T_Fact_Sales.Company_Key(Foreign Key)
    There are some other measures which i am mapping them in interface.
    Can anyone explain the procedure how to map Surrogate KEY of a dimension table to fact table???
    Thanks in advance
    regards
    Gourisankar
    Edited by: user10220907 on Oct 29, 2008 10:06 PM

  • How to create foreign key automatically?

    I am writing to seek help, in regards creating foreign key automatically, when I insert data into my ''price'' table.  I have 2 tables, one called prices and names.  the relationship between them, if that one name can have many prices and one price
    can have many names (many-to-many). Hence, i have junction table called  "Name_Prices", as shown below in the sample database schema:
    Names
    name_id [pk]
    name
    type
    UploadDate
    Prices
    Price_id [pk]
    name_id [fk]
    price
    uploadDate
    Name_Prices
    name_id REFERENCE names (name_id)
    price_id REFERENCE prices (price_id)
    PRIMARY KEY (name_id, price_id)
    The  price's data input comes in as CSV file everyday. (please see the example below) :
    name name_type price UploadDate
    ALBA MBS 93.5 17/10/2014
    ALESC Trup 58 17/10/2014
    ALESC Trup 52 17/10/2014
    My desire goal/output is to be able to create a functionality, where I can insert the price's data into the database (''prices''), it will automatically insert foreign key in the price
    table (from the names table), and if there is a new price's name, then the database will create a new name id for it, in the name's table, transferring the name, its type, from the CSV input data. 
    In order to achieve this task, where would I start implementing this logic?(in SQL server or application-side) what steps does this involve and is this task achievable, all in sql server side (i.e. store procedure, functions etc..). 
    Apology in advance, if the question is not clear to understand, i happy to follow up with further questions, if required.  
    Any help would be very appreciated. Many thanks

    As noted above, I modified the design:
    Products
    Product_id [pk]
    Product
    type
    UploadDate
    Prices
    Price_id [pk]
    price
    uploadDate
    Product_Prices
    Product_id REFERENCE Products (Product_id)
    price_id REFERENCE prices (price_id)
    PRIMARY KEY (Product_id, price_id)
    Note
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • How to create text table

    can anyone tell, how to create text table in abap.

    Hi,
    Follow this procedure
    To create a text table for a table ZABC,
    1. you have to create a ZABCT table with the field = all the primary fields of table ZABC + SPRSL type SPRAS + Text field.
    2. Every other field except the text field should be primary key fields.
    3. Maintain a foreign key relationship between ZABC and ZABCT over the field required field (in TSTCT the required field is TCODE).
    4. Activate the table.
    5. Now you should be able to traverse to the text table ZABCT from ZABC (menu path: Goto->Text Table)
    Hope this will help.
    Regards,
    Nishit

  • How to create Text Tables and Value Tables ?

    Hi all,
    How we can create the Text Table ? Step by Step
    How we can create the Value Table ? Step by Step
    Note : I am not asking about the creation of simple transparant table ...
    Thanks In advance.
    How to use Text tables ?
    With Example Please..
    Thanks in advance.
    Regards.
    Raj

    Hi Raj,
    Table A is a text table of table B if the key of A comprises the key of B and an additional language key field (field of data type LANG). Table A may therefore contain explanatory text in several languages for each key entry of B.
    To link the key entries with the text, text table A must be linked with table B using a foreign key. Key fields of a text table must be selected here for the type of foreign key fields
    If table B is the check table of a field, the existing key entries of table B are displayed as possible input values when the input help (F4) is pressed. The explanatory text (contents of the first character-like non-key-field of text table A) is also displayed in the user's logon language for each key value in table B.
    Only one text table can be created for table B! The system checks this when you attempt to activate a table with text foreign keys for B.
    Regards
    Aneesh.

  • Create same table (all constraints)

    Hi all
    I have a table and I want to duplicate this table. Including all constraints...
    I used
    create table new_table as
    select * from old_table
    I created this table, but there's no constraints...
    Thanks...

    Hi,
    Then you need use DBMS_METADATA.GET_DDL as others said before.
    SGMS@ORACLE10> set linesize 1000
    SGMS@ORACLE10> set pagesize 1000
    SGMS@ORACLE10> set long 9999999
    SGMS@ORACLE10> SELECT DBMS_METADATA.GET_DDL('TABLE','MYTABLE','SGMS') FROM DUAL;
    DBMS_METADATA.GET_DDL('TABLE','MYTABLE','SGMS')
      CREATE TABLE "SGMS"."MYTABLE"
       (    "IEM_ENTIDADE" VARCHAR2(2) NOT NULL ENABLE,
            "IEM_ANO" CHAR(4) NOT NULL ENABLE,
            "IEM_FORMA_ENTRADA" NUMBER(1,0) NOT NULL ENABLE,
            "IEM_DOC" NUMBER(6,0) NOT NULL ENABLE,
            "IEM_LANC" NUMBER(3,0) NOT NULL ENABLE,
            "IEM_ORDEM" NUMBER(3,0) NOT NULL ENABLE,
            "IEM_DATA" DATE NOT NULL ENABLE,
            "IEM_ALMOX" NUMBER(3,0) NOT NULL ENABLE,
            "IEM_ORIGEM" CHAR(3) NOT NULL ENABLE,
            "IEM_GRUPO" NUMBER(3,0) NOT NULL ENABLE,
            "IEM_CLASSE" NUMBER(3,0) NOT NULL ENABLE,
            "IEM_ITEM" NUMBER(4,0) NOT NULL ENABLE,
            "IEM_UN_AQUISICAO" VARCHAR2(3) NOT NULL ENABLE,
            "IEM_QUANT" NUMBER(15,4) NOT NULL ENABLE,
            "IEM_VAL_UNITARIO" NUMBER(11,4) NOT NULL ENABLE,
            "IEM_FATOR_CONV" NUMBER(6,0) NOT NULL ENABLE,
            "IEM_OPERACAO" CHAR(1) NOT NULL ENABLE,
            "IEM_QUANT_DIST" NUMBER(15,4) NOT NULL ENABLE,
            "IEM_IPI_VALOR" NUMBER(11,2),
            "IEM_IPI_PERCENT" NUMBER(11,2),
            "IEM_LOTE" VARCHAR2(20),
            "IEM_LOTE_DEST" NUMBER NOT NULL ENABLE,
            "IEM_DESCONTO" NUMBER(15,2) DEFAULT 0,
            "IEM_DATA_VENC" DATE,
            "IEM_GARANTIA" DATE,
            "IEM_ASSIST_TECNICA" VARCHAR2(2000),
             CONSTRAINT "AETIEM_PK" PRIMARY KEY ("IEM_ENTIDADE", "IEM_ANO", "IEM_FORMA_ENTRADA", "IEM_DOC", "IEM_LANC")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 327680 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "SIGMA"  ENABLE,
             CONSTRAINT "AETIEM_FK" FOREIGN KEY ("IEM_ENTIDADE", "IEM_GRUPO", "IEM_CLASSE", "IEM_ITEM")
              REFERENCES "SGMS"."AET_PRO" ("PRO_ENTIDADE", "PRO_GRUPO", "PRO_CLASSE", "PRO_ITEM") ENABLE,
             CONSTRAINT "AETIEM_FK1" FOREIGN KEY ("IEM_UN_AQUISICAO")
              REFERENCES "SGMS"."AET_PRO_UN" ("UN_SIGLA") ENABLE,
             CONSTRAINT "AETIEM_FK2" FOREIGN KEY ("IEM_ENTIDADE", "IEM_ANO", "IEM_FORMA_ENT
    RADA", "IEM_DOC")
              REFERENCES "SGMS"."AET_EM" ("EM_ENTIDADE", "EM_ANO", "EM_FORMA_ENTRADA", "EM_DOC") ON DELETE CASCADE ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 786432 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "SIGMA"And after this you change the name of the table and perform a insert into select statement
    But if you wanted get separeted DDL commands, you can use these options below too:
    FK        -> select dbms_metadata.get_dependent_ddl ('REF_CONSTRAINT','<table_name>') text from dual;
    PK,CHK,UK -> select dbms_metadata.get_dependent_ddl ('CONSTRAINT','<table_name>') text from dual;
    TRIGGER    -> select  dbms_metadata.get_dependent_ddl('TRIGGER','<table_name>') from dual;
    INDEX     -> select  dbms_metadata.get_dependent_ddl('INDEX','<table_name>') from dual;
    Example to get just the Foreign Keys:
    SGMS@ORACLE10> select dbms_metadata.get_dependent_ddl ('REF_CONSTRAINT','MYTABLE') text from dual;
    TEXT
      ALTER TABLE "SGMS"."MYTABLE" ADD CONSTRAINT "AETIEM_FK" FOREIGN KEY ("IEM_ENTIDADE", "IEM_GRUPO", "IEM_CLASSE", "IEM_ITEM")
      REFERENCES "SGMS"."AET_PRO" ("PRO_ENTIDADE", "PRO_GRUPO", "PRO_CLASSE", "PRO_ITEM") ENABLE
      ALTER TABLE "SGMS"."MYTABLE" ADD CONSTRAINT "AETIEM_FK1" FOREIGN KEY ("IEM_UN_AQUISICAO") REFERENCES "SGMS"."AET_PRO_UN" ("UN_SIGLA") ENABLE
      ALTER TABLE "SGMS"."MYTABLE" ADD CONSTRAINT "AETIEM_FK2" FOREIGN KEY ("IEM_ENTIDADE", "IEM_ANO", "IEM_FORMA_ENTRADA", "IEM_DOC")
      REFERENCES "SGMS"."AET_EM" ("EM_ENTIDADE", "EM_ANO", "EM_FORMA_ENTRADA", "EM_DOC") ON DELETE CASCADE ENABLECheers

  • Error while creating temporary table

    Hi All,
    I am trying to integrate ODI and BAM . I have followed all the steps given in the guide.While creating interface i am getting the error while LKM is working.
    I am using LKM SQL to SQL and IKM Oracle BAM Insert ( as the inserted data should be captured after inserting).
    http://download.oracle.com/docs/cd/E12839_01/integration.1111/e10224/bam_odi.htm
    Please use this link for clarification.For me drop work table and create work table failed (C$ -work table). Anyone have any idea about this could you help me?
    Thanks in advance,
    Gnanaprakasam

    It seems the table(MMMORDERFILE_C$_REQUEST ) already exist in the work schema,so cant able to create and throw an error. can you tell me which KM you are using?

Maybe you are looking for