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.

Tags: Database

Similar Questions

  • Problem with Create Table from target in CKM Oracle

    In CKM following Oracle are:
    create table < % = snpRef.getTable ("L", "CHECK_NAME", "W") % >
    (
    Catalog_name < %=snpRef.getDataType ("DEST_VARCHAR", "100", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    Schema_name < %=snpRef.getDataType ("DEST_VARCHAR", "100", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    RESOURCE_NAME < %=snpRef.getDataType ("DEST_VARCHAR", "100", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    FULL_RES_NAME < %=snpRef.getDataType ("DEST_VARCHAR", "100", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    ERR_TYPE < %=snpRef.getDataType ("DEST_VARCHAR", "1", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    ERR_MESS < %=snpRef.getDataType ("DEST_VARCHAR", "250", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    CHECK_DATE < %=snpRef.getDataType ("DEST_DATE", "", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    ORIGINAL < %=snpRef.getDataType ("DEST_VARCHAR", "100", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    CONS_NAME < %=snpRef.getDataType ("DEST_VARCHAR", "35", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    CONS_TYPE < %=snpRef.getDataType ("DEST_VARCHAR", "2", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    ERR_COUNT < %=snpRef.getDataType ("DEST_NUMERIC", "10", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >
    )

    What is product is...
    create the table ETL_STAGING. SNP_CHECK_TAB
    (
    CATALOG_NAME VARCHAR2 (100 CHAR) NULL,
    SCHEMA_NAME VARCHAR2 (100 CHAR) NULL,
    RESOURCE_NAME VARCHAR2 (100 CHAR) NULL,
    FULL_RES_NAME VARCHAR2 (100 CHAR) NULL,
    ERR_TYPE VARCHAR2 (1 CAR) NULL,
    ERR_MESS VARCHAR2 (250 CHAR) NULL,
    CHECK_DATE DATE NULL,.
    ORIGINAL VARCHAR2 (100 CHAR) NULL,
    CONS_NAME VARCHAR2 (35 CHAR) NULL,
    CONS_TYPE VARCHAR2 (2 CHAR) NULL,
    ERR_COUNT NUMBER (10) NULL
    )

    Why it adds the word TANK in parenthesis? Anyone?

    Tom Cusick

    Hello

    Follow these steps:

    (1) go to the topology

    (2) physical architecture

    (3) modify the Oracle (directory) technology

    4) go to the tab "other".

    (5) change the "String Mask" (4º-text box) to: VARCHAR2 (%)

    That will solve the problem.

    Cezar Santos

  • Problem with creating tables DB DWH

    Hello
    During the generation of tables of data warehouse (dry 4.10.1 how to create the Data Warehouse Tables), I got to the top with an error indicating that "Datawarehouse Creating tables failed '.
    But when I checked in the log "generate_ctl.log" file, it has the message below:

    + "Schema will be created in the following containers: +"
    Oracle 11.5.10
    Oracle R12
    Universal



    Conflict between containers:


    ---------------------------------------------
    Table name: W_BOM_ITEM_FS
    Column name: INTEGRATION_ID.
    + Column properties that are different: [keyTypeCode] +.
    ---------------------------------------------

    Success! "

    When I checked in the database of DWH, I find tables DWH, but do not know if all tables have been created?
    Can someone tell me if my DWH tables are all created? Tables of how much would be created for EBS containers above?
    Also, should I have to drop a container of EBS to create tables DWH successfully?

    The Installation guide States when creating tables DWH fails then "createtables.log" will not be created. But in my case, this log file is created.

    Published by: userOO7 on November 19, 2008 14:41

    Even if you do the install with DBA role, it will fail is that sse_role is not present. Please, create it and try again. You must also create a user of separate database to the data warehouse that is separate from the repository of DAC. Then you can remove and re-create the account of data warehouse without losing the DAC repository.

    4.3.4.1 create databases
    http://download.Oracle.com/docs/CD/E12127_01/doc/BIA.795/e12083/windows_ic.htm#i1081422

  • create table as select or parallel table / * + parllel() * /.

    Dear Experts,


    I have two huge table almost 300 GB each.
    create table as 
    select * from table t1 ,t2
    where t1.row_id=t2.row_id
    How to run this query in parllelism. Withou Parlell, it takes too much time.

    as it should be
    create table parallel 15 as 
    select * from t1,t2;
    or in another way

    and if it was it y 3 table to join to

    My * wrote:
    Dear Experts,

    I have two huge table almost 300 GB each.

    create table as
    select * from table t1 ,t2
    where t1.row_id=t2.row_id
    

    How to run this query in parllelism. Withou Parlell, it takes too much time.

    as it should be

    create table parallel 15 as
    select * from t1,t2;
    

    or in another way

    and if it was it y 3 table to join to

    What happens if the slowdown occurs on SELECT it & not create?

  • Problem with a table

    Hello

    Sorry for my bad English.

    I have a problem with a table. I made a table with a script, but when I add a new line, this script will not work in the new lines. I know that I have something wrong, but I do not know the solution. Anyboy help me? You can see the file in http://www.frmgm.jazztel.es/duda.pdf. I am new in programming.

    I thank you very much.

    OK, now I understand... each row that you add to the table changes the somExpression for objects (so that they are unique). The repeating subform Gets a case number, but the rest of the phrase remains the same. If you do not include a number of occurrence, then the 1st appearance is supposed to... that is why only the 1st row is affected. You can build expressions so that you can derive the correct number of occurrence. The click event code would look like this:

    If (xfa.resolveNode ("Tabla1.Fila1 [" + this.parent.index + "]").) Casillaverificacion1.RawValue == '0') {}
    xfa.resolveNode ("Tabla1.Fila1 [" + this.parent.index + "]"). Casillaverificacion2.access = "readOnly";
    xfa.resolveNode ("Tabla1.Fila1 [" + this.parent.index + "]"). Casillaverificacion3.access = "readOnly";
    xfa.resolveNode ("Tabla1.Fila1 [" + this.parent.index + "]"). Casillaverificacion4.access = "readOnly";
    xfa.resolveNode ("Tabla1.Fila1 [" + this.parent.index + "]"). Boton1.presence = 'hidden ';
    } else {}
    xfa.resolveNode ("Tabla1.Fila1 [" + this.parent.index + "]"). Boton1.presence = "visible";
    xfa.resolveNode ("Tabla1.Fila1 [" + this.parent.index + "]"). Casillaverificacion1.access = "readOnly";
    xfa.resolveNode ("Tabla1.Fila1 [" + this.parent.index + "]"). Casillaverificacion2.access = "open";
    xfa.resolveNode ("Tabla1.Fila1 [" + this.parent.index + "]"). Casillaverificacion3.access = "readOnly";
    xfa.resolveNode ("Tabla1.Fila1 [" + this.parent.index + "]"). Casillaverificacion4.access = "readOnly";
    }

    You can see that the xfa.resolveNode takes a string that represents the object we want to use. The string is then built and the number of occurrence of the Fila1 subform is derived by obtaining the index number of the subform parent of the object that we clicked (this.parent.index). Occurane numbers are wrapped in [] brackets.  The rest has not changed. You will need to update your code to use this technique.

    Hope that helps

    Paul

  • Create table as select execution Issues

    I have a table that is 190 million lines (TableA). The database is on the storage of very old and slow. I'll try the following: create table TableB in the select * from TableA where field1 < 10000 [this should translate into about 36 million lines for the new table]

    The problem is: I started this work at 20:00 and 02:00 is still not create the table. My thoughts are that it accumulates the lines into a temporary table, initially based on the where clause and then it goes to create the table. fix? That being said, the customer has a problem with the execution of this request during the opening hours, BUT it does start in writing during the outage window (20:00-02:00) and, in fact, I never get to this point. In fact, the early stages making the ETG is not this CPU intensive, I should be able to start the ETG before 20:00 without too much grumbling and I hope that the part of writing occurs during the window [i.e.: start the ETG at 14:00]. Is there a way to determine how long a DEC will take before you actually create the table?

    Anyone know if I'm wrong about the way that Oracle treats this type of DEC?

    Thank you

    To speed up the DEC options

    (1) NOLOGGING
    (2) PARALLEL

    http://download.Oracle.com/docs/CD/E11882_01/server.112/e25523/parallel003.htm#BEIFIDIE

    How useful PARALLEL might be depends on your environment (in particular, the number of processors).

    Werner

  • Calc problem with fact table measure used in the bridge table model

    Hi all

    I have problems with the calculation of a measure of table done since I used it as part of a calculation in a bridge table relation.

    A table of facts, PROJECT_FACT, I had a column (PROJECT_COST) whose default aggregate is SUM. Whenever PROJECT_COST was used with any dimension, the appropriate aggregation was made at appropriate levels. But, no more. One of the relationships that project_fact is a dimension, called PROJECT.

    PROJECT_FACT contains details of employees, and every day they worked on a project. So for one day, employee, Joe, could have a PROJECT_COST $ 80 to 123 project, the next day, Joe might have $40 PROJECT_COST for the same project.

    Dimension table, PROJECT, contains details of the project.

    A new feature has been added to the software - several customers can now be charged to a PROJECT, where as before, that a single client has been charged.
    This fresh percentage collapse is in a new table - PROJECT_BRIDGE. PROJECT_BRIDGE has the project, CUSTOMER_ID, will BILL_PCT. BILL_PCT always add up to 1.

    Thus, the bridge table might look like...
    CUSTOMER_ID BILL_PCT PROJECT
    123 100.20
    123 200.30
    123 300.50
    456 400 1.00
    678 400 1.00

    Where to project 123, is a breakdown for multiple clients (. 20,.30.50.)

    Let's say in PROJECT_FACT, if you had to sum up all the PROJECT_COST for project = 123, you get $1000.


    Here are the steps I followed:

    -In the physical layer, PROJECT_FACT has a 1:M with PROJECT_BRIDGE and PROJECT_BRIDGE (a 1:M) PROJECT.
    PROJECT_FACT = > PROJECT_BRIDGE < = PROJECT

    -In the logical layer, PROJECT has a 1:M with PROJECT_FACT.
    PROJECT = > PROJECT_FACT

    -Logical fact table source is mapped to the bridge table, PROJECT_BRIDGE, so now he has several tables, it is mapped (PROJECT_FACT & PROJECT_BRIDGE). They are defined for an INTERNAL join.
    -J' created a measure of calculation, MULT_CUST_COST, using physical columns, which calculates the sum of the PROJECT_COST X the amount of the percentage in the bridge table. It looks like: $ (PROJECT_FACT. PROJECT_COST * PROJECT_BRIDGE. BILL_PCT)
    -J' put MULT_CUST_COST in the presentation layer.

    We still want the old PROJECT_COST autour until it happened gradually, it is therefore in the presentation layer as well.


    Well, I had a request with only project, MULT_CUST_COST (the new calculation) and PROJECT_COST (the original). I expect:

    PROJECT_COST MULT_CUST_COST PROJECT
    123. $1000 $1000

    I'm getting this for MULT_CUST_COST, however, for PROJECT_COST, it's triple the value (perhaps because there are quantities of 3 percent?)...

    PROJECT_COST MULT_CUST_COST PROJECT
    123 $1000 (correct) $3000 (incorrect, it's been tripled)

    If I had to watch the SQL, you should:
    SELECT SUM (PROJECT_COST),
    SUM (PROJECT_FACT. PROJECT_COST * PROJECT_BRIDGE. BILL_PCT),
    PROJECT
    Of...
    PROJECT GROUP


    PROJECT_COST used to work properly at a table of bridge of modeling.
    Any ideas on what I got wrong?

    Thank you!

    Hello

    Phew, what a long question!

    If I understand correctly, I think the problem is with your old measure of cost, or rather that combines with you a new one in the same request. If you think about it, your request as explained above will bring back 3 rows from the database, that's why your old measure of cost is multiplied. I think that if you took it out of the query, your bridge table would work properly for the only new measure?

    I would consider the migration of your historical data in the bridge table model so that you have one type of query. For historical data, each would have a single row in the bridge with a 1.0 BILL_PCT.

    Good luck

    Paul
    http://total-bi.com

  • 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 the Tables of the Buliding warehouse...

    Hi all

    I want to try to create tables DWH via Dac.but now I have error
    takes i.e) Done.some will be fail.we use Sibel 8.1.1 System.
    Once I chicked my logfile.

    createwtables.log

    Siebel Enterprise Applications ODBC import utility, Version 7.7 DDL [18030] ENU
    Copyright (c) 2001 Siebel Systems, Inc. All rights reserved.

    This software is the property of Siebel Systems, Inc., 2207 Bridgepointe Parkway,
    San Mateo, CA 94404.

    The user accepts that any use of this software is governed by: (1) the there is
    the user limits and other conditions of the license agreement which
    has been concluded with Siebel Systems or their dealers. and
    (2) the notice of rights exclusive and limited included in this software.

    WARNING: THIS SOFTWARE IS COPYRIGHTED BY THE AMERICAN AND INTERNATIONAL.
    ANY REPRODUCTION, DISTRIBUTION OR USE OF THIS PROGRAM, OR ANY PART
    OF IT, MAY RESULT IN HEAVY CIVIL AND CRIMINAL PENALTIES, AND WILL BE
    BEING PROSECUTED TO THE EXTENT POSSIBLE UNDER THE LAW.

    If you received this software by mistake, please notify Siebel Systems
    immediately at (650) 295-5000.

    C:\orahome\10gR3_1\bifoundation\dac\UTILITIES\BIN\DDLIMP/i N/s N/u OLAPUSER/p * / OLAP_USER/g SSE_ROLE/f C:\orahome\10gR3_1\bifoundation\dac/conf/sqlgen/ctl-file/oracle_bi_dw.ctl/b/k/x/w Y c

    Connecting to the database...
    Connected.

    Reading tables and DDL file indexes...
    Read 1110 tables and indexes the DDL file 0...

    Existing scheme of reading...
    Read the tablespaces 0, 0 tables and the indexes 0 a schema from existing...

    Running the SQL statements to the database...

    S1000: [DataDirect] [ODBC Oracle driver] [Oracle] ORA-01031: insufficient privileges

    create table M_10A_ORG_D)
    Number DATASOURCE_NUM_ID (10, 0) not null,
    Number (10, 0) ETL_PROC_WID default 0 non-zero.
    Number (10, 0) GEO_WID default 0 non-zero.
    INTEGRATION_ID varchar2 (30 char) not null,
    Number (10, 0) ROW_WID default 0 non-zero.
    Char ACCNT_FLG (1 car).
    ACCNT_REVN (22: 7), the number
    Char ACTIVE_FLG (1 car).
    Char CHANNEL_FLG (1 car).
    CHNL_ANNL_SALES (22: 7), the number
    Char COMPETITOR_FLG (1 car).
    Date of CREATED_DT,
    Char DIVN_FLG (1 car).
    EMP_COUNT (22: 7), the number
    Date of FORMED_DT,
    HIST_SLS_VOL (22: 7), the number
    Char ORG_FLG (1 car).
    Char ORG_PRTNR_FLG (1 car).
    Char PROSPECT_FLG (1 car).
    Date of PRTNRSHP_START_DT,
    Char PRTNR_FLG (1 car).
    PRTNR_SALES_RANK (22: 7), the number
    PTNTL_SLS_VOL (22: 7), the number
    Date of PTSHP_END_DT,
    Char PTSHP_FEE_PAID_FLG (1 car).
    Date of PTSHP_RENEWAL_DT,
    PTSHP_SAT_INDEX (22: 7), the number
    Char PUBLIC_LISTING_FLG (1 car).
    Number SALES_EMP_CNT (10, 0),
    Number SERVICE_EMP_CNT (10, 0),
    U_ACCNT_RVN (22: 7), the number
    Date of U_ACNTRVN_EXCH_DT,
    U_CHNL_ANNL_SLS (22: 7), the number
    Date of U_CH_ASLS_EXCH_DT,
    U_HIST_SLS_VOL (22: 7), the number
    Date of U_HST_SLS_EXCH_DT,
    Date of U_PTL_SLS_EXCH_DT,
    U_PTL_SLS_VOL (22: 7), the number
    ACCNT_LOC varchar2 (50 char),
    ACCNT_STATUS varchar2 (30 char),
    ACCNT_STATUS_I varchar2 (50 char),
    ACCNT_TYPE_CD varchar2 (30 char),
    ACCNT_TYPE_CD_I varchar2 (50 char),
    ANNUAL_REVN_CAT varchar2 (30 char),
    ANNUAL_REVN_CAT_I varchar2 (50 char),
    BASE_CURCY_CD varchar2 (20 char),
    BU_NAME varchar2 (100 char),
    CHNL_SALES_GRWTH varchar2 (30 char),
    CHNL_SALES_GRWTH_I varchar2 (50 char),
    CITY varchar2 (50 char),
    COUNTRY varchar2 (30 char),
    DIVN_TYPE_CD varchar2 (30 char),
    DIVN_TYPE_CD_I varchar2 (50 char),
    DOM_ULT_DUNS_NUM varchar2 (15 char),
    DUNS_NUM varchar2 (15 char),
    EXPERTISE varchar2 (30 char),
    EXPERTISE_I varchar2 (50 char),
    FREQUENCY_CAT varchar2 (30 char),
    FREQUENCY_CAT_I varchar2 (50 char),
    FRGHT_TERMS_CD varchar2 (30 char),
    FRGHT_TERMS_CD_I varchar2 (50 char),
    GLBLULT_DUNS_NUM varchar2 (15 char),
    KEY_COMPETITOR varchar2 (100 char),
    LINE_OF_BUSINESS varchar2 (30 char),
    MAIN_PH_NUM varchar2 (40 char),
    MGR_NAME varchar2 (160 char),
    MONETARY_CAT varchar2 (30 char),
    MONETARY_CAT_I varchar2 (50 char),
    NAME varchar2 (100 char),
    NUM_EMPLOY_CAT varchar2 (30 char),
    NUM_EMPLOY_CAT_I varchar2 (50 char),
    ORG_CITY varchar2 (50 char),
    ORG_COUNTRY varchar2 (30 char),
    ORG_MAIN_PH_NUM varchar2 (40 char),
    ORG_MGR_NAME varchar2 (160 char),
    Nom_org varchar2 (100 char),
    ORG_PRTNR_TIER varchar2 (30 char),
    ORG_PRTNR_TIER_I varchar2 (50 char),
    ORG_PRTNR_TYPE varchar2 (30 char),
    ORG_PRTNR_TYPE_I varchar2 (50 char),
    ORG_STATE varchar2 (50 char),
    ORG_ST_ADDRESS varchar2 (200 char),
    ORG_TERR_NAME varchar2 (75 char),
    ORG_ZIPCODE varchar2 (30 char),
    PAR_DUNS_NUM varchar2 (15 char),
    PAR_INTEGRATION_ID varchar2 (30 char),
    PAR_ORG_NAME varchar2 (100 char),
    PRI_LST_NAME varchar2 (50 char),
    PRTNR_NAME varchar2 (100 char),
    PR_COMPETITOR varchar2 (100 char),
    PR_INDUST_NAME varchar2 (50 char),
    PR_ORG_TRGT_MKT varchar2 (50 char),
    PR_PTSHP_MKTSEG varchar2 (50 char),
    PTSHP_PRTNR_ACCNT varchar2 (100 char),
    PTSHP_STAGE varchar2 (30 char),
    PTSHP_STAGE_I varchar2 (50 char),
    RECENCY_CAT varchar2 (30 char),
    RECENCY_CAT_I varchar2 (50 char),
    Varchar2 (30 char) REGION,
    REGION_I varchar2 (50 char),
    REVN_GROWTH_CAT varchar2 (30 char),
    REVN_GROWTH_CAT_I varchar2 (50 char),
    Varchar2 (50 char) STATE,
    ST_ADDRESS varchar2 (200 char),
    U_ACNTRVN_CURCY_CD varchar2 (20 char),
    U_CH_ASLS_CURCY_CD varchar2 (20 char),
    U_HST_SLS_CURCY_CD varchar2 (20 char),
    U_PTL_SLS_CURCY_CD varchar2 (20 char),
    VIS_PR_BU_ID varchar2 (15 char),
    VIS_PR_POS_ID varchar2 (15 char),
    CODE POSTAL varchar2 (30 char))
    ;
    error writeExecDDL (UTLOdbcExecDirectDDL pDDLSql).
    error writeExecDDL (pOperCallback UTLDbDdlOperTblCreate).
    Error in MainFunction (UTLDbDdlDbMerge).
    Error in the Main function...


    Please let me know how reslove this error...

    Use the setup.exe from Disk1\install\win32
    ex: D:\DAC_V16377-01\dac\Disk1\install\win32

    It works without any problem

    Score pls help if

  • Problem with 'show tables' syntex and dashes

    I am currently working on an application that requires me to all tables in a database of output.
    The name of the database consists of the domain name (which include a dash "-") and a name I specified when creating.

    So, when I use:
    < name cfquery = "qTables" > display tables < / cfquery >
    < cfdump var = "" #qTables # "/ >"

    I get a result with the table with the title of the column names: TABLES_IN_DOMAIN-NAME_DBNAME.
    When I try to refer to this variable, SEE process only the name before (and not including) the dashboard.
    So the error I get is: "Element TABLES_IN_DOMAIN is undefined in QTABLES.

    Is there a way around this problem?
    Thank you in advance.

    You can reference the query using the notation of the structure


    #qTables ["TABLES_IN_DOMAIN-NAME_DBNAME"] [currentRow] #.

  • problem with creating a logical sequence

    create table t (a varchar2 (20), b number (8));
    insert into values t ('aa', 4);
    insert into values t ('ba', 6);
    Insert values into t ('ca', 7);
    insert into values t ('da', 8);


    instead of 8, it can be any number between 1 and 100

    If instead of number 8 is < 10
    Insert into t values('ea',10); -what I need dynamic insertion

    If instead of the number between 11-19 then
    Insert into t values('ea',20); -what I need dynamic insertion


    and so on


    I tried like below
    Select case when max (b) < 10 then 10 when max (b) between 10 and 20, then 20 end of t;

    but I can not write the case for again and again up to nth

    Insert into t ("ea" ceil ((select max (b) from t) / 10)) * 10);

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

  • Create Table As select from a PLSQL Package

    Hello

    I'm trying to use an Assignment statement in a stored procedure using Execute Immediate.

    I first create the script in a variable:

    v_sql: = 'CREATE TABLE ' | v_archive_partition_name |
    "TABLESPACE TBS_ARCHIVE |
    "STORAGE (INITIAL 20 M) |
    "AS COMPRESS |
    ' SELECT *' |. '
    'FROM ' | v_table_name |
    «PARTITION (' |)» v_archive_partition_name | ' ) ' ||
    "ORDER BY". v_sort_order | '';

    Then I run:

    EXECUTE IMMEDIATE v_sql;

    When I run the present, I get an error of incorrect permissions, but if I run the SQL that is created manually by using the same user it creates the table correctly.

    Can someone tell me what grants should I apply for my procedure create this table correctly?

    Can someone tell me what grants should I apply for my procedure create this table correctly?

    acquired through ROLE privileges do not apply in the PL/SQL procedure named.
    GRANT must be explicitly made

    IMO, application should NOT do the DOF between application version releases.

  • Need to answer with Create Table

    Hi guys OTN.


    I would ask, what is the difference between this two syntax.

    create table table_name as
    select * from other_table;
    and
    create table table_name as
    (select * from other_table);
    Thank you and more power!

    Hello

    Cloud Nines Bliss wrote:
    Hi guys OTN.

    I would ask, what is the difference between this two syntax.

    create table table_name as
    select * from other_table;
    

    and

    create table table_name as
    (select * from other_table);
    

    There is no difference. Oracle allows often in brackets when they are not needed. For example:

    SELECT  SYSDATE - (1 / 24)    AS one_hour_ago
    FROM    dual;
    

    The result would be the same if you have lost the parentheses, but it is nice to make in this case, to clarify that the / operation is being doen before the...

  • 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

Maybe you are looking for

  • I have a problem with apple ID signin?

    I have a problem with sign - in the apple ID and the device says you must answer security question or send other messages and I don't remember this e-mail and security question and I have urgent emails so please I want to quickly solve this problem (

  • used to install iTunes 12.3.2. App Store says it has been downloaded 4 times

    The App store is trying to install 12.3.2 itunes after my upgrade to El Capitan. App store says he did it four times. When I run itunes, I always 12.3.1.23. What now? Is the app store is going to try to install forever?

  • import photos from the iPod touch to mac

    Plugged my iPod touch Mac - and unable to highlight or show pictures to import on Mac.  It happened only on connect initial to iPod for Mac, but if you did not transfer the pictures so I can't get the photos recognized again by simply plugging in the

  • the last time I fell on hotmail

    He asked me to reset my password I did, now I do not remember my password... now what? I got the same email for more than a decade, I throw that one company threw this account

  • Security blocking a download

    I'm stuck to display Slingtv, which I just bought. The message said that DEP is blocking me. I want to remove DEP so that I can consult Slingtv