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
*/

Similar Messages

  • TIPS(29) : TABLE에 걸려 있는 INDEX 찾아 보기

    제품 : SQL*PLUS
    작성날짜 : 1996-12-27
    TIPS(29) : TABLE에 걸려 있는 INDEX 찾아 보기
    ===========================================
    /* show_index.sql USAGE: Show the indexes on a table */
    /* This script prompts the user for the table owner and name then gets */
    /* the indexed columns for any indexes on the table */
    column index_name format A20
    column column_name format A25
    column column_position format 999 heading 'Pos'
    column uniq format a5
    set verify off
    break on index_name skip 1
    select C.index_name,substr(I.uniqueness,1,1) uniq, C.column_name,
    C.column_position
    from all_ind_columns C
    ,all_indexes I
    where C.table_owner = upper('&table_owner')
    and C.table_name = upper('&table_name')
    and C.index_owner = I.owner
    and C.index_name = I.index_name
    order by 2 desc,1,4
    /

  • 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

  • TIPS(12) : TABLE에 대하여 EXTENT 발생 량 산정 방법

    제품 : SQL*PLUS
    작성날짜 : 1996-11-05
    TIPS(12) : TABLE에 대하여 EXTENT 발생 량 산정 방법
    =================================================
    /* 모든 TABLE에 대하여 각각의 EXTENT 발생 량을 산정한다 */
    set linesize 80
    set pages 66
    set echo off
    set termout off
    spool report/extent.lst
    column owner no print new_value owner
    break on owner page
    ttitle cen 'Extent Definition Owner : ' owner skip 1 -
    cen '------------------------------------------' skip 1;
    col f1 format a40 heading 'OBJECT NAME'
    col f2 format a10 heading 'TYPE'
    col f3 format 99,999,999 heading 'TOTAL EXTS'
    select a.owner owner, a.segment_name f1,
    segment_type f2,
    extents f3
    from dba_segments a
    where a.owner not in ('SYS','SYSTEM','SCOTT')
    and extents > 1
    spool off
    exit

  • 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.

  • Dynamic Tool TIP in Table Control

    Dear Friends,
    Thanks in Advance.
    How to implement Dynamic Tool TIP in the Table Control for Particularly One Columnn.
    i.e rows in that Column.
    Note : Column contains Currency Type Data
    For that column, i am calculating the Quantity Multiplied with the Exchange Rate.
    That Calculation should be visible in the Tool TIP.
    Regards:
    Sridhar.J

    Hi
    Take Text Element Radio button there  and give any number and activate.
    If the Visible lenght of the Table Control Field is less than actual length of the Content, it automatically displays the Tool Tip.
    I just did it.
    Hope this serves your purpose.
    Get it fram Sam
    "  Hey Sreedhar, Let us know how can we do it , it will be helpful.
    Cheers
    Ram
    Edited by: Ramchander Krishnamraju on Jan 2, 2010 4:06 AM

  • 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 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

  • 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.

  • How to implement Tool TIP in Table Control

    Hello Everyone,
    Can you please tell me how to implement a tooltip messages in table control columns.
    The Tooltip contains a simple message like "Doublde click on column.
    Thanks in advance.
    Edited by: Suruchi Razdan on Jun 6, 2011 7:57 AM

    Hello,
    In table Control->first Header Row has chance to maintain the Tooltip option.
    In table control columns maintain Double click options in attributes .
    Regards,
    Praveen

  • Multi table constraint or using a complex condition for a constraint

    Something went wrong with this post

    Hi,
    Let me try to help...
    You don't need to have the FK defiined in the database to use it at ODI, at true, with this feature, you can even define a FK between technologies (for instance, file to oracle).
    In your case, if I understood right, as there are concatenated values into the child column, you could use a Condition, in the Orders table, like:
    length(replace(orders.DISCOUNT_CODES, ' ',null)) !=
    (select count(*)
    from (select substr(orders.DISCOUNT_CODES, rPos, 1) rDC
    from (select level rPos
    from dual
    connect by level <11
    ) tab_DC,
    Discount
    where tab_DC.rDC = discount.DISCOUNT_CODE
    In this way, the amout of code in the orders.DISCOUNT_CODES must be the same of a count from the union of each individual code wiht the DISCOUNT TABLE.
    Please try it, I just write withou test once I didn't create your tables here.
    Does it work for you?
    Cezar Santos
    [www.odiexperts.com]
    Edited by: Cezar Santos - www.odiexperts.com on 29/09/2009 19:22

Maybe you are looking for

  • Apple New Wireless keyboard issue

    I purchased an apple wireless keyboard a month or so ago, and all was fine. A few days ago, I must have touched some combination of keys that now have the effect of NOT allowing me to type using the keyboard. I changed the batteries and checked the b

  • IPad notes not visible

    Can't get my notes or account to be visible in Notes. Account is listed for mail.

  • How do I get the bookmarks in the bookmarks tool bar to actually display in FF4?

    In V4, when I turn the bookmarks tool bar on as described in the help, Firefox creates a blank row in the tool bar area, but the bookmarks in my toolbar still do not show. I've tried to turn on display of the tool bar through both the Options menu an

  • Blackberry Typing Random Letters/Calling Random People

    My phone is constantly putting o's into every word, and often just straight up barely types. It also is continuously calling numbers even after I've deleted them from my phone. I called Bell and they had me wipe my phone and that didn't do anything,

  • Find the open order po qty

    Where can u find the open po for a particular time period I am assuming this  you can get open PO from EKPO and deduct any qty received against PO using table EKBE entry with PO history category E(GR) But how do i take care that open PO is not delete