Doubt on Table Constraints

I have a table say OLD_TABLE. Now I want to create another table say NEW_TABLE which should be EXACTLY the same as OLD_TABLE. When I say "EXACTLY" the same I mean the data type of all the columns, Constraints (if any), primary key and foreign keys (if any) and every other thing must be the same as OLD_TABLE. Only the rows (or data) will differ between OLD_TABLE and NEW_TABLE and nothing else.
What query should I ues to acheive this? Pls advice!
Edited by: TuX4EvA on Dec 18, 2009 2:00 AM

You may want to have a look at DBMS_METADATA package.
As an example:
sql> set long 4000
sql> select dbms_metadata.get_ddl('TABLE','EUL_GW_COLS','ODM_USER') from dual;
DBMS_METADATA.GET_DDL('TABLE','EUL_GW_COLS','ODM_USER')
  CREATE TABLE "ODM_USER"."EUL_GW_COLS"
   (    "C_O_SCHEM_NAME" VARCHAR2(64) NOT NULL ENABLE,
        "C_O_OBJ_NAME" VARCHAR2(64) NOT NULL ENABLE,
        "C_COL_NAME" VARCHAR2(64) NOT NULL ENABLE,
        "C_SQL_DERIVATION" VARCHAR2(240),
        "C_DATATYPE" VARCHAR2(70) NOT NULL ENABLE,
        "C_NULL_INDICATOR" VARCHAR2(10) NOT NULL ENABLE,
        "C_HIDDEN" VARCHAR2(1) NOT NULL ENABLE,
        "C_LENGTH" NUMBER(22,0),
        "C_DECIMAL_PLACES" NUMBER(22,0),
        "C_DISP_NAME" VARCHAR2(100),
        "C_HEADING" VARCHAR2(240),
        "C_DESCRIPTION" VARCHAR2(240),
        "C_DISP_SEQ" NUMBER(22,0),
        "C_DISP_LENGTH" NUMBER(22,0),
        "C_CASE_DISPLAY" VARCHAR2(10),
        "C_CASE_STORAGE" VARCHAR2(10),
        "C_ALIGNMENT" VARCHAR2(10),
        "C_FORMAT_MASK" VARCHAR2(100),
        "C_C_LOV_SCHEM_NAME" VARCHAR2(64),
        "C_C_LOV_OBJ_NAME" VARCHAR2(64),
        "C_C_LOV_COL_NAME" VARCHAR2(64),
        "C_DEF_ROLLUP_FUNC" VARCHAR2(70),
        "C_DISP_NULL_VALUE" VARCHAR2(240),
        "C_ORD_CLAUSE_POS" NUMBER(22,0),
        "C_ORD_DIRECTION" VARCHAR2(10),
        "C_PLACEMENT" VARCHAR2(10),
        "C_CONTENT_TYPE" VARCHAR2(100),
         CONSTRAINT "EUL_GW_COLS_UNQ" UNIQUE ("C_O_SCHEM_NAME", "C_O_OBJ_NAME", "C_COL_
NAME")
  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 "USERS"  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 "USERS"It will give you the exact DDL to create the same table with all the constraints in place including primary keys, foreign keys and not nulls.
You will only need to replace the names for anything suitable to you.
LW

Similar Messages

  • TIPS(30) : TABLE에 걸려 있는 CONSTRAINT 찾아 보기

    제품 : SQL*PLUS
    작성날짜 : 1996-12-27
    TIPS(30) : TABLE에 걸려 있는 CONSTRAINT 찾아 보기
    ================================================
    REM Script:
    REM tbconst.sql
    REM
    REM
    REM NOTE * Need select access against sys.dba_cons_columns and
    REM sys.dba_constraints to run this.
    REM
    REM Parameter:
    REM owner = owner of the table
    REM table = name of table to report on
    REM
    REM Usage:
    REM SQL> @tbconst.sql
    REM
    REM Oracle Version:
    REM Tested on Version 7.1.4 as a dba user
    REM Tested on Version 7.2.3 as user sys
    REM
    /* Capture owner and table name parameters
    def owner = &&1
    def table_name = &&2
    /* Define working variables
    def gScript = 'tbconst.sql'
    def gTitle = 'Constraints against table &owner..&table_name'
    /* Set the system variables
    set concat on
    set echo off
    set embedded off
    set pagesize 58
    set showmode off
    set space 1
    set termout on
    set trimout on
    set verify off
    set wrap on
    /* Get today's date
    set termout off
    col today new_value now noprint
    select to_char(sysdate, 'DD Mon YYYY HH:MIam') today
    from dual;
    /* Get the name of the database
    col dbname new_value sid noprint
    select name dbname
    from v$database;
    /* Set the report title based on the information gathered and passed
    clear breaks
    set termout on
    set heading on
    ttitle -
    left 'Database: &sid' right now skip 0 -
    left ' Report: &gScript' right 'Page ' sql.pno skip 2 -
    center '&gTitle' skip 2
    set newpage 0
    /* Run the Report
    set linesize 80
    set arraysize 1
    create or replace package mitconstraint as
    function mit$getcols ( cn_name in varchar2,
    cn_owner in varchar2,
    tb_name in varchar2)
    return varchar2;
    pragma restrict_references (mit$getcols, WNDS,WNPS);
    function mit$getdesc ( cn_name in varchar2,
    cn_owner in varchar2,
    tb_name in varchar2)
    return varchar2;
    pragma restrict_references (mit$getdesc, WNDS,WNPS);
    end mitconstraint;
    create or replace package body mitconstraint as
    function mit$getcols (
    cn_name in varchar2,
    cn_owner in varchar2,
    tb_name in varchar2)
    return varchar2
    as
    val varchar2(500);
    col_name varchar2(30);
    found boolean;
    cursor c1 is
    select column_name
    from sys.dba_cons_columns
    where constraint_name = upper(cn_name) and
    owner = upper(cn_owner) and
    table_name = upper(tb_name);
    Begin
    val := '';
    found := FALSE;
    for record in c1 Loop
    if found = FALSE then
    found := TRUE;
    else
    val := val ||', ';
    end if;
    val := val || record.column_name;
    end loop;
    return val;
    end mit$getcols;
    function mit$getdesc (
    cn_name in varchar2,
    cn_owner in varchar2,
    tb_name in varchar2)
    return varchar2
    as
    cn_type char(1);
    descr varchar2(2000);
    found boolean;
    cursor c1 is
    select owner || '.' || table_name val
    from sys.dba_constraints
    where r_owner = upper(cn_owner) and
    r_constraint_name = upper(cn_name);
    begin
    found := FALSE;
    descr := '';
    select constraint_type
    into cn_type
    from sys.dba_constraints
    where constraint_name = upper(cn_name) and
    owner = upper(cn_owner) and
    table_name = upper(tb_name);
    if cn_type = 'U' then
    descr := ' ';
    else if cn_type = 'P' then
    descr := 'Referenced by: ';
    for record in c1 loop
    if found = FALSE then
    found := TRUE;
    else
    descr := descr || ', ';
    end if;
    descr := descr || record.val;
    end loop;
    else if cn_type = 'R' then
    select 'References ' || b.owner || '.' || b.table_name
    into descr
    from dba_constraints a,
    dba_constraints b
    where a.table_name = upper(tb_name) and
    a.owner = upper(cn_owner) and
    a.constraint_name = upper(cn_name) and
    b.owner = a.r_owner and
    b.constraint_name = a.r_constraint_name;
    else if cn_type = 'C' then
    select search_condition
    into descr
    from dba_constraints
    where
    constraint_name = upper(cn_name) and
    owner = upper(cn_owner) and
    table_name = upper(tb_name);
    descr := ltrim(descr);
    else
    descr := ' ';
    end if;
    end if;
    end if;
    end if;
    return descr;
    end mit$getdesc;
    end mitconstraint;
    col constraint_name format a12 heading 'Constraint|Name'
    col type format a11 heading 'Type'
    col cols format a21 heading 'Columns'
    col des format a33 heading 'Description'
    select constraint_name,
    'Primary Key' type,
    mitconstraint.mit$getcols(constraint_name,'&owner','&table_name') cols,
    mitconstraint.mit$getdesc(constraint_name,'&owner','&table_name') des
    from dba_constraints
    where owner=upper('&owner') and
    table_name = upper('&table_name') and
    constraint_type = 'P'
    union
    select constraint_name,
    'Referential' type,
    mitconstraint.mit$getcols(constraint_name,'&owner','&table_name') cols,
    mitconstraint.mit$getdesc(constraint_name,'&owner','&table_name') des
    from dba_constraints
    where owner=upper('&owner') and
    table_name =upper('&table_name') and
    constraint_type = 'R'
    union
    select constraint_name,
    'Table Check' type,
    mitconstraint.mit$getcols(constraint_name,'&owner','&table_name') cols,
    mitconstraint.mit$getdesc(constraint_name,'&owner','&table_name') des
    from dba_constraints
    where owner=upper('&owner') and
    table_name = upper('&table_name') and
    constraint_type = 'C'
    union
    select constraint_name,
    'View Check' type,
    mitconstraint.mit$getcols(constraint_name,'&owner','&table_name') cols,
    mitconstraint.mit$getdesc(constraint_name,'&owner','&table_name') des
    from dba_constraints
    where owner=upper('&owner') and
    table_name = upper('&table_name') and
    constraint_type = 'V'
    union
    select constraint_name,
    'Unique' type,
    mitconstraint.mit$getcols(constraint_name,'&owner','&table_name') cols,
    mitconstraint.mit$getdesc(constraint_name,'&owner','&table_name') des
    from dba_constraints
    where owner=upper('&owner') and
    table_name = upper('&table_name') and
    constraint_type = 'U'
    order by 2,1
    drop package mitconstraint;
    /* Clear variables
    undefine 1
    undefine 2
    undefine owner
    undefine table_name
    undefine gScript
    undefine gTitle
    ttitle off
    btitle off
    clear column
    clear breaks
    /* End of Script
    */

  • PRIMARY KEY-FOREIGN KEY 관계 찾기(MASTER TABLE CONSTRAINT 정보 찾는 SQL)

    제품 : ORACLE SERVER
    작성날짜 : 2003-06-19
    PRIMARY KEY-FOREIGN KEY 관계 찾기
    =================================
    PURPOSE
    이 자료는 MASTER TABLE CONSTRAINT 정보를 찾는 SQL이다.
    Explanation
    SCOTT의 EMP table의 Foreign Key와 부모 제약 조건을 찾으려면
    다음의 질의문을 사용하여 찾을 수 있다.
    SQL> alter table dept add constraint dept_pk primary key (deptno);
    Table altered.
    SQL> alter table emp add constraint emp_dept_fk foreign key(deptno)
    references dept(deptno);
    Table altered.
    SQL> select c.constraint_name as "foreign key",
    p.constraint_name as "referenced key",
    p.constraint_type,
    p.owner,
    p.table_name
    from dba_constraints c, dba_constraints p
    where c.owner = 'SCOTT'
    and c.table_name = 'EMP'
    and c.constraint_type = 'R'
    and c.r_owner = p.owner
    and c.r_constraint_name = p.constraint_name;
    foreign key referenced key C OWNER TABLE_NAME
    EMP_DEPT_FK DEPT_PK P SCOTT DEPT
    Example
    none
    Reference Documents
    <Note:1010844.6>

    I don't have intimate knowledge of SQL Server, but to me, your code seems reasonable. I guess there is some "fine point" (a bug?) to using self referenceing foreign keys in SQL Server. It doesn't seem plausible that the error originates with the driver, unless it's a very intelligent kind of driver.
    A "Gordian Knot" kind of solution to your problem is to ask whether you really need the foreign key constraint in the db schema. Is the table used by something other than your EJB? Anyway, putting logic responsible for the correct functioning of your EJB into the db schema is often a bad practice, as it makes the code harder to understand, maintain, port etc.

  • DM 2.0 - No DDL at all after removing Table Constraints

    Hi,
    I'm using SQL Datamodeler 2.0 build 584
    When trying to generate DDL from my relational model (when physical model opened) nothing is generated.
    (after clicking Ok in window DDL Generation Options window DDL File Editor stays empty)
    If I close the physical model and try again, now the DDL is generated.
    This is all occuring after I had to make a couple of datamodel changes including the removal of two Table Constraints.
    Previously I could generate without a problem.
    Looking at the table constraints (after seeing the log-file) I see that the Table constraints are removed m the relational model but not from the physical model.
    When attempting to remove these table constraints from the physical model (delete in right-click menu) nothing happens.
    Anyone who knows what is going on?
    Enrico
    Logfile:
    2011-02-11 15:10:09,344 [AWT-EventQueue-0] ERROR DDLViewer - DDLViewer
    java.lang.NullPointerException
         at oracle.dbtools.crest.exports.ddl.oracle.v10g.SSBTableOraclev10g.appendTableLevelCheckConstraints(Unknown Source)
         at oracle.dbtools.crest.exports.ddl.oracle.v10g.SSBTableOraclev10g.doAppend(Unknown Source)
         at oracle.dbtools.crest.exports.ddl.SQLStatementBuilder.appendTo(Unknown Source)
         at oracle.dbtools.crest.exports.ddl.SQLStatementBuilder.appendTo(Unknown Source)
         at oracle.dbtools.crest.exports.ddl.SQLStatementBuilder.appendTo(Unknown Source)
         at oracle.dbtools.crest.exports.ddl.SQLStatementBuilder.appendTo(Unknown Source)
         at oracle.dbtools.crest.exports.ddl.SQLStatementBuilder.appendTo(Unknown Source)
         at oracle.dbtools.crest.exports.ddl.SQLStatementBuilder.appendTo(Unknown Source)
         at oracle.dbtools.crest.exports.ddl.DDLGenerator.appendDDLFor(Unknown Source)
         at oracle.dbtools.crest.swingui.ddl.DDLViewer.ddlPreview(Unknown Source)
         at oracle.dbtools.crest.swingui.ApplicationView.setDDLViewerVisible(Unknown Source)
         at oracle.dbtools.crest.swingui.diagram.relational.TableDiagramCell$4.actionPerformed(Unknown Source)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266)
         at java.awt.Component.processMouseEvent(Component.java:6134)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
         at java.awt.Component.processEvent(Component.java:5899)
         at java.awt.Container.processEvent(Container.java:2023)
         at java.awt.Component.dispatchEventImpl(Component.java:4501)
         at java.awt.Container.dispatchEventImpl(Container.java:2081)
         at java.awt.Component.dispatchEvent(Component.java:4331)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)
         at java.awt.Container.dispatchEventImpl(Container.java:2067)
         at java.awt.Window.dispatchEventImpl(Window.java:2458)
         at java.awt.Component.dispatchEvent(Component.java:4331)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

    then you have to remove it manually from XML file in physical model:
    1) check the ID of table with removed check constraint (in relational model - table dialog, Summary page)
    2) find related file in physical model - <ID in step1>.xml - it should be located in path like this one - rel\1\phys\D9582E4E-2ED963CB9D32\Table\
    there is another file in path like this "rel\1\table" - this is for relational model
    3) find table constraint section in XML file
    it should look like this:
    <storage_object type="TableCheckConstraint" id="B868DAE9-1859-A695-7969-A819F29F568C">
                   <name>TABLE_2_CK</name>
                   <comment></comment>
                   <notes></notes>
                   <alter type="created">
                        <user></user>
                        <timestamp>2011-02-11 18:37:27</timestamp>
                   </alter>
                   <alter type="changed">
                        <user></user>
                        <timestamp>2011-02-11 18:37:27</timestamp>
                   </alter>
                   <properties>
                        <parameter name="object.property.auto.ConstraintID" value="77C506AB-6665-3E79-66D2-6E152BDB1E9B" />
                        <parameter name="object.property.auto.ConstraintName" value="TABLE_2_CK" />
                        <parameter name="object.property.auto.Deferrable" value="NO" />
                        <parameter name="object.property.auto.Enable" value="YES" />
                        <parameter name="object.property.auto.ExceptionsTable" value="NO_OBJECT" />
                        <parameter name="object.property.auto.GeneratedInRDBMS" value="false" />
                        <parameter name="object.property.auto.Initially" value="IMMEDIATE" />
                        <parameter name="object.property.auto.LongName" value="TABLE_2_CK" />
                        <parameter name="object.property.auto.MarkedGenerate" value="true" />
                        <parameter name="object.property.auto.Name" value="TABLE_2_CK" />
                        <parameter name="object.property.auto.NameHasQuotes" value="false" />
                        <parameter name="object.property.auto.RawObject" value="false" />
                        <parameter name="object.property.auto.Table" value="5FEBE67C-6B01-174B-EF13-276A47FE019C" />
                        <parameter name="object.property.auto.Validate" value="YES" />
                        <parameter name="design.owner" value="test_table_constr" />
                        <parameter name="object.existsinrepository" value="true" />
                   </properties>
              </storage_object>
    4) remove definition, save the file
    5) repeat with other involved tables
    Philip

  • How to get SQL script for generating table, constraint, indexes?

    I'd like to get from somewhere Oracle tool for generating simple SQL script for generating table, indexes, constraint (like Toad) and it has to be Oracle tool but not Designer.
    Can someone give me some edvice?
    Thanks!
    m.

    I'd like to get from somewhere Oracle tool for
    generating simple SQL script for generating table,
    indexes, constraint (like Toad) and it has to be
    Oracle tool but not Designer.
    SQL Developer is similar to Toad and is an Oracle tool.
    http://www.oracle.com/technology/products/database/sql_developer/index.html

  • Table constraint for date

    Is there any way to define constraint on date data type at table level?
    I would like to ensure the data at the time of entering (tbale constraint level) that joining date should be greater than birth date.
    I'll appreciate if you can answer my query.
    jay

    I assume joining date is a column is same table. If so:
    SQL> create table user533470(
      2                          birth_date date,
      3                          joining_date date
      4                         )
      5  /
    Table created.
    SQL> alter table user533470
      2    add constraint user533470_chk1
      3      check(
      4            joining_date > birth_date
      5           )
      6  /
    Table altered.
    SQL> insert
      2    into user533470
      3    values(
      4           DATE '1987-11-22',
      5           DATE '2007-1-1'
      6          )
      7  /
    1 row created.
    SQL> insert
      2    into user533470
      3    values(
      4           DATE '1987-11-22',
      5           DATE '1987-11-22'
      6          )
      7  /
    insert
    ERROR at line 1:
    ORA-02290: check constraint (SCOTT.USER533470_CHK1) violated
    SQL> SY.

  • Doubt about table locks

    i have a master table from which many other child tables take data for various summarizations. I have a cron tab in unix which calls oracle stored procedures to populate each of these tables in a sequential manner. For example table 1 starts getting populated at 6 am and is reading data from master table and the process goes on till 8 am. If another table 2 starts getting populated at 7 am and has to get data from the same rows as table 1 is reading . Will table 2 be able to access the mater table entirely without missing any rows?
    Thank you

    Given we have no version number and no code we have no way of knowing what you are or are not doing. Not even whether foreign key constraints exist. Thus no help is possible based on what little you've posted.
    The one bit of advice I will give is that I have not found a valid reason to use a *NIX cron job in a decade. Assuming a currently supported version of the product throw it away and use DBMS_SCHEDULER.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Create table - constraints

    Dear all,
    I have some tables and I need to create them but I cannot. Need help
    Create table address (
    some column name
    CONSTRAINT IXADDRE0 PRIMARY KEY (ID),
    FOREIGN KEY (FK_ADDRESS_TYPE)
    REFERENCES ADDRESS_TYPE (CODE),
    FOREIGN KEY (FK_COUNTRY)
    REFERENCES COUNTRY (ISO_CODE),
    FOREIGN KEY (FK_RELATION)
    REFERENCES RELATION (NUMBER0)
    ON DELETE CASCADE
    Can I create this table is the way mentioned below.
    Create table address (
    some column name
    CONSTRAINT IXADDRE0 PRIMARY KEY (ID)
    alter table address add (
    FOREIGN KEY (FK_ADDRESS_TYPE)
    REFERENCES ADDRESS_TYPE (CODE),
    FOREIGN KEY (FK_COUNTRY)
    REFERENCES COUNTRY (ISO_CODE),
    FOREIGN KEY (FK_RELATION)
    REFERENCES RELATION (NUMBER0)
    ON DELETE CASCADE
    waiting for answer.
    Thanks
    SL
    sorry for the trouble. I have done it.
    Message was edited by:
    user480060

    Have you tried the Oracle SQLReference_ guide? It has the complete syntax, including diagrams and examples.

  • Enable Novalidate a table constraint

    I created a table with a unique constraint on one column DISABLED. I then proceeded to insert duplicate data in this field. When I try to ENABLE NOVALIDATE this constraint, I get the error ORA-02299: cannot validate (SCOTT.SARAH_U) - duplicate keys found. With the NOVALIDATE option, shouldn't it ignore existing records?
    My statement was: alter table sarah enable novalidate unique (cd);
    It seems as if the "novalidate" keyword is not being read.
    Thanks for any help.

    The syntax is:
    SQL> ALTER TABLE scott.sarah_u MODIFY CONSTRAINT <constraint_name> ENABLE NOVALIDATE;
    Hope this helps!
    Rob
    I created a table with a unique constraint on one column DISABLED. I then proceeded to insert duplicate data in this field. When I try to ENABLE NOVALIDATE this constraint, I get the error ORA-02299: cannot validate (SCOTT.SARAH_U) - duplicate keys found. With the NOVALIDATE option, shouldn't it ignore existing records?
    My statement was: alter table sarah enable novalidate unique (cd);
    It seems as if the "novalidate" keyword is not being read.
    Thanks for any help.

  • Doubt on Table Partitions

    hello,
    i am junior dba our company deals with health care products,
    in our project we have a USER REGISTRATION table,in which every user should
    register in that table before joining in the hospital.
    That table contains lakhs of records ,and we made date wise partitions on that table.
    Now my doubt is, all the transactions that are under the particular month will store
    in the appropriate partition.
    for example:
    All the data in the month (MARCH) will store in the (MARCH)partition
    my table contains USERREGISTEREDDATE field default is SYSDATE.
    Now i wan't to change the USERREGISTEREDDATE field which is
    stored in the (MARCH)partition to APRIL ,it is not allowing to change the date,
    because registrations that are done under MARCH are stored in that (MARCH)partition
    can u please give solution to me
    regards
    lakshmi

    Migration of rows to new partitions based on key value changes can be controlled by application of the ENABLE/DISABLE ROW MOVEMENT clause in the CREATE and ALTER TABLE statements.
    ALTER TABLE tableName ENABLE ROW MOVEMENT;
    ~ Madrid.

  • Table Constraints not Replicated with Table Published in WebToGo

    I have the problem related in metalink Note:167611.1
    But i don't understand the next paragraf:
    The first time the user goes offline, these DDL statements are executed.
    Can any body help me?

    Basically when you create a snapshot to include in you mobile application, any constraints are ignored (as are indexes, and column valid values constraints). This means when you synchronise your client device with the mobile server for the first time, the snapshots are created as tables in the oracle lite database (note always created as tables, even if your snapshot is based on a view in the main system). A primary key constraint and a primary key index will also be created.
    Within the different mobile application development tools (eg: workbench, packaging wizard, the API definitions, the web.xml file etc.) there is the ability to define DML statements.
    These are standard SQL statements (normally DML type statements like create table, create constraint, create index, create view, but can be used for other things like insert into a table) that are run WHEN THE ORACLE LITE DATABASE IS CREATED.
    This last bit is important. They are designed to be used for the kind of thing that you run once and then never again (eg: running the same create table statement would fail the second time around).
    This means that if you have already created the oracle lite database on a client, and then you need to add in dml statements to set up constraints etc., you will have to delete the database files (odb files) from the client, and sync to re-create the database.
    NOTE does not help with constraints, but indexes can be added to the snapshot definitions, and these will cause an update to create them the next time the user synchronises, without the need to drop the client database

  • How to compare the table, constraint, stored proc, view between 2 schema ?

    Hi All,
    We have two schema : app_test & app_prod :
    app_test is where user run acceptance test, and where we make correction etc
    app_prod is where user prepare data for going live/production.
    Now we need to make sure that :
    table structure
    stored proc
    view
    function
    sequence
    constraint ...
    Is the SAME between the two schema : Is there any script that can automate the process ?
    Thank you very much,
    xtanto

    You may use TOAD, OEM, and use "ALL_" views to compare.
    And also, take a look into the duplicate thread on this forums.
    How to compare two oracle database schemas
    You can also check in the google for any free tools for this !!
    Regards,
    Sabdar Syed.

  • Doubt in table control

    I have a table control on a custom screen containing several rows of data depending on the user input on the selection screen . This table control has 5 columns .
    The first column name is KEY . it contains value of a number of fields concatenated together forming a key .
    For eg : the fields are matnr mblnr xblnr , so the value in this column would be something like : value of all 3 fields together without any space . My problem is that i do not know the number of these fields till run time , so i do not know whether the key field will contain data from 5 fields or 4 fields ..
    My question is this : I want to make the column heading dynamic for this field ..for eg if there is data for 2 fields like matnr and xblnr ,then the heading shud be material number - xblnr or if there are 4 fields ..then the heading shud be the description of those 4 fields ..
    Is this possible . Can i make the column header of a table control dynamic .
    Kindly help me out as it is urgent ..
    I will duly reward all ..
    Thanks in advance
    Ankit

    Hi Ankit,
    I dont think its possible in Table Control to change the column headings dynamically.
    But this is possible in ALV. You just need to put a If condition in the field catalog.
    Will suggest you to go for ALV.
    Best regards,
    Prashant
    Pls. mark points for helpful answers

  • Doubt on Table Filter

    Hi,
    I am using JDeveloper 11.1.1.4 and ADF-BC in my project.
    In one of my pages,I display a table with 3 columns with one of the columns displaying a dropdown[selectOneChoice] and other 2 columns with input texts[Ex:EmpName,Salary,Sex[Male/Female] ].
    I have filter enabled in my table. For the dropdowns I display Male/Female in U.I and store M/F in DB.
    But the problem is for the filter, it works only if I give M/F..but it should work for Male/Female as this is data user sees.
    Please advice on how to achieve this.
    Regards,
    Praveen

    its better if you do it programatically like
    http://fusionstack.blogspot.com/2009/08/adf-table-and-qbe.html

  • Doubt in tables for Graphs and Charts

    Hi all
    I have finished with the creation of bar graph and pie graph for anothe application but iam unable to get the tables that displays the data for the graphs... Also the pie graph and bar graph are coming at a stretch i donot have the option of selecting the Bar graph and Pie graph...
    Pls help me out in fixing this issue
    Ganesh

    Hi all
    I have finished with the creation of bar graph and pie graph for anothe application but iam unable to get the tables that displays the data for the graphs... Also the pie graph and bar graph are coming at a stretch i donot have the option of selecting the Bar graph and Pie graph...
    Pls help me out in fixing this issue
    Ganesh

Maybe you are looking for