Adding Default Values to a Large Table in 11gR2

All,
For 11g, I understand that the way that we add columns with default values is different. I'm running 11.2.0.3 on AIX 5.3.
For instance, if I do this:
ALTER TABLE mark_heavily_used_table ADD random_field2 VARCHAR2(10) DEFAULT 'Seven' NOT NULL;
Instead of updating all the rows which already exists in the table, the database instead pings the data dictionary view for the default value for this column.
This is great whenever I come to ADD or MODIFY a column. But wouldn't this increase the time it takes to SELECT from the rows which have columns 'pointing' to the data dictionary view? Instead of a straight SELECT on the table, won't it have to do two operations (go to table, find it's got a default value and then go to data dictionary)?
Mark

It has to go to the dictionary anyways, so the only additional time is rewriting the select return results. See January 5, 2012 reply in https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:2575782100346318728

Similar Messages

  • What kind  of  index on limited number of distinct values in a large table

    Hi all,
    can any one help me
    what kind of index on limited number of distinct values in a large table
    Thanks,

    Hi,
    it's better to do full table scan when values are evenly distributed. Indexes are good when you want to select less than 10% of all data (it depends).
    BUT you can use index when there is another data distribution - e.g. value 'Unprocessed' 1%, 'Processed' 99% (and you have computed statistics). Generally in datawarehouse you could use bitmap index, because it is small and fast, but it's not suitable in OLTP with many data modification. Then you can use b-tree index or functional index.
    create index idx on mytable (decode('Unprocessed', 1, null));This funcional index will be small and fast too, because there won't be any null values (but you must use this clause in select statement to use index).

  • Adding default value for a select-options in a selection-screen

    hello gurus,
    i have a report program with the following select-options in a selection-screen block:
    select-options:  so_site  for MyTable-werks.
    i want the so_site to have a default value once the program displays. can it be possible?
    regards,
    sid

    Hi sid,
    1. Whenever we use select-option,
       an internal table of type range is
      automatically created.
    2. so, in fact, we have to put
       record in this internal table.
    3. eg. Just copy paste in new program.
    4.
    report abc.
    tables : t001.
    select-options : bukrs for t001-bukrs.
    initialization.
      bukrs-sign = 'I'.
      bukrs-option = 'EQ'.
      bukrs-low = '1000'.
      append bukrs.
    regards,
    amit m.

  • How to set a default value in an ADF table when adding a new row

    Hi Guys,
    I have a view object which I am using to create an ADF table. I also have a button which uses a CreateInsert binding to add a new row to the table. I have four fields: created_by, creation_date, last_update_by and last_update_date.
    I want these values to be set automatically when I click add new row.
    The values I want are:
    created_by - admin
    creation_date - sysdate
    last_update_by - admin
    lsat_update_date - sysdate
    Any suggestions on how to do this would be appreciated
    Thanks
    -Mark

    mark,
    Those four fields can be set completely declaratively in the Entity Object (check out the History Colum feature). Copied from the (11g) documentation:
    If you need to keep track of historical information in your entity object, such as when an entity was created or modified and by whom, or the number of times the entity has been modified, you specify an attribute with the History Column option selected (in the Edit Attribute dialog).
    If an attribute's data type is Number, String, or Date, and if it is not part of the primary key, then you can enable this property to have your entity automatically maintain the attribute's value for historical auditing. How the framework handles the attribute depends which type of history attribute you indicate:
    * Created On: This attribute is populated with the time stamp of when the row was created. The time stamp is obtained from the database.
    * Created By: The attribute is populated with the name of the user who created the row. The user name is obtained using the getUserPrincipalName() method on the Session object.
    * Modified On: This attribute is populated with the time stamp whenever the row is updated/created.
    * Modified By: This attribute is populated with the name of the user who creates or updates the row.
    * Version Number: This attribute is populated with a long value that is incremented whenever a row is created or updated.
    John

  • Adding the values fed in the table

    Hi
    i want to add the values of one column in the table that are given by the user. I  set the "calculated" property of the corresponding context element in the controller as true and then writing the code for it. But when i run my application, then even if i give valid data in the corresponding column, it still shows the message errors i have set for the validations and clears the field.
    is there any way in which this can be calculated without setting the "calculated" property as true?
    If yes, then how to access the values of the column?
    Thanks & regards,
    Anupreet

    Hi,
    Without using the Calculated property you can proceed the following way suppose you have a Node A with attribute a,b,c.
    then you can get each of these values using
    wdContext.current<name of node>element().get<attribute>();
    The above code gives the value for currently selected row.
    Similarly you can get all attributes and perform the required operations.
    To get  values for particular row you can use
    wdContext.node<name of node>().get<name of node>ElementAt(i).get<attribute name>();
    Here i is the index of the particular row.
    Hope this helps.
    Revert back for further clarification.
    Regards,
    Leena

  • Fill the default value in ranges internal table

    ranges: rg_ord for vbap-vbeln.
          REFRESH rg_ord[].
          SELECT vbeln AS low
          INTO CORRESPONDING FIELDS OF TABLE rg_ord
          FROM vbap
          WHERE vbeln . . . . some condition.
          IF rg_ord[] IS NOT INITIAL.
            LOOP AT rg_ord.
              rg_ord-sign = 'I'.
              rg_ord-option = 'EQ'.
              MODIFY rg_ord TRANSPORTING sign option.
            ENDLOOP.
            CONCATENATE cond_syntax ' vbap~vbeln in rg_ord'
            INTO cond_syntax SEPARATED BY space.
          ENDIF.
    <b>IS there anyway i can avoid the loop</b>. I can think of modifying the sql like this
         SELECT
          vbeln AS low
          'I' as sign
          'EQ' as option
         INTO CORRESPONDING FIELDS OF TABLE rg_ord
         FROM vbap
         WHERE vbeln . . . . some condition.
    but regrettably open sql is not allowing literals into the select list.

    Hi,
    I think you only to sign to be 'I' and option to be 'EQ'.
    your code should be..
    if not rg_ord[] is initial.
           rg_ord-sign = 'I'.
           rg_ord-option = 'EQ'.
           MODIFY rg_ord TRANSPORTING sign option where value ne space.
    *here since you are not modifying the value,the value remains the same
    endif.
    You cannot code as you stated in SQL.
    If you make your code as
    SELECT
          vbeln  INTO CORRESPONDING FIELDS OF TABLE rg_ord
         FROM vbap
         WHERE vbeln in rg_ord.
    will handle the for the condition you specified.
    Kindly reward points by clicking the star on the left of reply,if it helps.
    Message was edited by: Jayanthi Jayaraman

  • Setting default value for form field assoc with a table column

    On a "Create Record" situation I was trying to set the default values of some form fields using a page level "Process". These form fields have Source Type = Database Column. It wasn't working, I could only set non-db assoc form field values no matter when the "Process" was set to exec. From some other posts it seems that this is by design, ie. not being able to programatically set the initial values of form fields that are sourced to db columns. I was hoping to have just one "Process" that would exec to set these initial values in one place rather than scattered about for each field that needed a default value. These particular default values come from ref tables and may be different for each user.
    So, it looks like I have to use a "Default Value" plsql chunk for each field on the form itself or else set their value on the calling form's Redirect in the "Set these Items" area.
    Is this correct?

    You could define a database function which accepts the name of the item and the user ID of the user running the application. Based on the item name and the user ID have the function return the appropriate initial value. Invoke this function in a "Default Value" PL/SQL block.
    Does that help in centralizing your initial values? You could have one function per page or one function per application. I would do one function per application.

  • How to Add column with default value in compress table.

    Hi ,
    while trying to add column to compressed table with default value i am getting error.
    Even i tried no compress command on table still its giivg error that add/drop not allowed on compressed table.
    Can anyone help me in this .
    Thanks.

    Aman wrote:
    while trying to add column to compressed table with default value i am getting error.This is clearly explain in the Oracle doc :
    "+You cannot add a column with a default value to a compressed table or to a partitioned table containing any compressed partition, unless you first disable compression for the table or partition+"
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#sthref5163
    Nicolas.

  • SQL Loader, nested tables and default values

    Is there a way to specify a default value for a nested table entry when SQL*Loader encounters a 'null' value?
    I want to avoid this:
    Record 5: Rejected - Error on table LEVEL_DESC, column LEVELS.
    NULL nested table element is not allowed

    Use the NULLIF parameter in your control file for the nested table objects.
    e.g
    LOAD DATA
    INFILE 'level_data.dat'
    INTO TABLE LEVEL
    (LEVEL_ID POSITION (01:05) CHAR
    LEVEL_NAME POSITION (07:20)
    LEVEL_DESC COLUMN OBJECT
    (LEVELS POSITION (22:25) CHAR NULLIF LEVEL_DESC.LEVELS=BLNAKS,
    ... ))

  • Hiii help to put default values on custom table

    Hiii
    Please advise how to put assign a default values on a custom table.
    Can you please indicate me the path to navigate to do that

    Please give more details
    where do you want default value while updating table entry or while using table maintenance ?

  • Field 'record_EMP_ID' doesn't have a default value

    I solved org.hibernate.TransientObjectException by adding "@OneToMany(fetch=FetchType.EAGER, cascade=CascadeType.ALL)"
    But this time values can't be inserted to DB.
    OS : Windows 7
    JDK : JDK 1.6
    JBoss : JBoss 5.1.0.GA
    DB : MySQL 5.5
    Error is "Field 'record_EMP_ID' doesn't have a default value"
    - Members.java
    @Entity
    @Table(name = "family")
    public class Members implements Serializable {
    @Id
    @Column(name = "EMP_ID")
    private String id ;
    @Column(name = "EMP_Passwd")
    private String passwd ;
    @Column(name = "EMP_Name")
    private String name ;
    @OneToMany(fetch=FetchType.EAGER, cascade=CascadeType.ALL)
    @JoinTable(name="info", joinColumns = {@JoinColumn(name = "EMP_Name")})
    private Collection<Records> record = new ArrayList();
    ....getter and setter
    - Records.java
    @Entity
    @Table(name = "info")
    public class Records implements Serializable {
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name = "EMP_ID")
    private int i;
    @Column(name = "EMP_Name")
    private String name;
    @Column(name = "EMP_Bank_Account")
    private String account;
    @Column(name = "EMP_Hobby")
    private String hobby;
    @Column(name = "EMP_Phone")
    private int phone;
    ...getter and setter method
    in jsp file I invoke EntityManager.persist
    Context ctx = new InitialContext();
    IMappingTestPort port = (IMappingTestPort) ctx.lookup("MappingTestBean/remote");
    Records r = new Records();
    r.setName("aaa");
    r.setAccount("111-2222");
    r.setHobby("bbb");
    r.setPhone(021112222);
    Members m = new Members();
    m.setId("aupres");
    m.setPasswd("aaa");
    m.setName("ccc");
    m.getRecord().add(r);
    port.setFamilyMember(m); // This EntityManager.persist method
    But it failed.
    In console
    20:21:29,233 INFO [STDOUT] Hibernate: insert into family (EMP_Name, EMP_Passwd, EMP_ID) values (?, ?, ?)
    20:21:29,268 INFO [STDOUT] Hibernate: insert into info (EMP_Bank_Account, EMP_Hobby, EMP_Name, EMP_Phone) values (?, ?, ?, ?)
    20:21:29,288 WARN [JDBCExceptionReporter] SQL Error: 1364, SQLState: HY000
    20:21:29,288 ERROR [JDBCExceptionReporter] Field 'record_EMP_ID' doesn't have a default value
    record_EMP_ID is automatically generated by hibernate
    Pls help!

    An update: 
    New virtual machines created after the integration is in place is visible in Virtual Machine Health Dashboard. No other dashboards seems to contain any data.

  • How to default values in LOV

    Hi,
    I have created a page in which I have two different LOVs. My requirement is to default some value in the First LOV i.e. "ALL"
    and the second LOV which is dependent on the first LOV will gets populated with the values based on the first one on the page load itself.
    Both the LOVs have "autoSubmit" and "partialTriggers"realtion between them.
    The problem I am facing is that I am able to set some default value to the first LOV with value as "ALL" by using "setSubmiitedValue" on LOV from backing bean on the page load but the second LOV popup (dependent LOV) is coming blank on page load.
    But if i select same value "ALL" form the first LOV popup after page load then second LOV popup gets populated with values based on first LOV
    Please provide some urgent help that how to default any LOV with some value and based on that second LOV gets populated on the page load itself.
    Thanks in Advance
    Kanika Dhamija

    Hi,
    Can you please explain a bit more the ' ... is to default some value.. ' part?
    When exactly do you want to set a default Value?
    Depending on your case, there is always the declarative way to consider through BC
    some approaches on different cases:
    How to set a default value in an ADF table when adding a new row
    http://www.youtube.com/watch?v=9WQ0SDVVWtE
    http://adfcodebits.blogspot.co.uk/2010/04/bit-13-overriding-create-to-set-default.html
    cascading LOVs
    http://andrejusb.blogspot.co.uk/2012/11/cascading-lovs-in-jdeveloper-111230.html
    hope this helps
    Regards,
    Dimitrios.

  • Default value 'sys_date' in an integer form YYYYMMDD without changing NLS

    I would need to define the default value in the alter table SQL, where I would set the default value of the current 'sys_date' in a string form 'YYYYMMDD' (8 varchar) without changing the session or system NLS settings.
    Would I need to invoke a PL/SQL procedure for this (if possible without it)?
    Dejan

    I have enclosed the SQL for creating my table, where I have to set the current date to today's date for the field 'DAT_VIR'. How do I set the TO_CHAR function in the SQL of the create or alter table SQL?
    Thanks!
    Dejan
    CREATE TABLE SCHEMA.TABLE
    FID NUMBER(10),
    GEOM MDSYS.SDO_GEOMETRY,
    LENGTH NUMBER(20,8),
    TIP_SPR VARCHAR2(10 CHAR) DEFAULT 'D',
    ID NUMBER(10),
    ID_UPR VARCHAR2(20 CHAR),
    SIF_VRSTE NUMBER(10) DEFAULT 6100,
    CC_KLAS NUMBER(5),
    TOPO NUMBER(10) DEFAULT 2,
    NAT_YX NUMBER(10),
    Z NUMBER(7,2),
    NAT_Z NUMBER(10),
    GJI NUMBER(10) DEFAULT 1,
    VIR NUMBER(10),
    DAT_VIR VARCHAR2(8 CHAR),
    MAT_ST NUMBER(7),
    MAT_GJS NUMBER(7),
    ID_EL VARCHAR2(15 CHAR),
    DAT_EL VARCHAR2(8 CHAR),
    DIM_YX NUMBER(6,2),
    DIM_Z NUMBER(6,2),
    OPU NUMBER(10) DEFAULT 1,
    ATR1 NUMBER(10),
    ATR2 NUMBER(10),
    ATR3 NUMBER(10),
    ATR4 VARCHAR2(8 CHAR),
    ATR5 VARCHAR2(5 CHAR),
    OPIS VARCHAR2(30 CHAR)
    COLUMN GEOM NOT SUBSTITUTABLE AT ALL LEVELS
    TABLESPACE USERS
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOGGING
    NOCOMPRESS
    LOB ("GEOM"."SDO_ELEM_INFO") STORE AS
    ( TABLESPACE USERS
    ENABLE STORAGE IN ROW
    CHUNK 8192
    PCTVERSION 10
    CACHE
    INDEX (
    TABLESPACE USERS
    STORAGE (
    INITIAL 64K
    NEXT 1
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    STORAGE (
    INITIAL 64K
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOB ("GEOM"."SDO_ORDINATES") STORE AS
    ( TABLESPACE USERS
    ENABLE STORAGE IN ROW
    CHUNK 8192
    PCTVERSION 10
    CACHE
    INDEX (
    TABLESPACE USERS
    STORAGE (
    INITIAL 64K
    NEXT 1
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    STORAGE (
    INITIAL 64K
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOCACHE
    NOPARALLEL
    MONITORING;

  • How to default values on screen using FREE_SELECTIONS_INIT

    Hi Experts,
    I have the following requirement :
    We have developed a screen on which there is a button. On click of the button, a dynamic selection screen is generated using the functions FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG.
    I want when the selection screen is generated for the first time, the fields on it contains some default values taken from a table.
    e.g. If Screen has fields MARA-MATNR, MARA-MTART, MARA-MEINS then MARA-MEINS should be defaulted with a value 'EA'.
    I have tried a lot but could not find a solution to it.
    Kindly help me out as this is very urgent.
    Points are guaranteed..
    Thanks in advance.
    Regards,
    Himanshu

    SELCTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK BLOCK_1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : P_RADLOC RADIOBUTTON GROUP GRP1 USER-COMMAND USER  .
    SELECTION-SCREEN BEGIN OF BLOCK SUB1_BLOCK WITH FRAME TITLE TEXT-002 NO INTERVALS.
    PARAMETERS : P_LOCNO TYPE /SAPAPO/LOCNO MODIF ID ABC default 'Specify the default value here.
    SELECTION-SCREEN END OF BLOCK SUB1_BLOCK.
    SELECTION-SCREEN SKIP .
    PARAMETERS : P_RADRES RADIOBUTTON GROUP GRP1  DEFAULT 'X'.
    SELECTION-SCREEN BEGIN OF BLOCK SUB2_BLOCK WITH FRAME TITLE TEXT-003 NO INTERVALS.
    PARAMETERS : P_RESNM TYPE /SAPAPO/RES_HEAD-NAME MODIF ID XYZ.
    PARAMETERS : P_NOB   TYPE /SAPAPO/CRES_NOINDIVRES  MODIF ID XYZ.
    SELECTION-SCREEN END OF BLOCK SUB2_BLOCK.
    SELECTION-SCREEN END OF BLOCK BLOCK_1.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF P_RADLOC = WL_SPACE .
          IF SCREEN-GROUP1 = WL_ABC.
            SCREEN-ACTIVE = 0.
            MODIFY SCREEN.
          ENDIF.
        ELSEIF P_RADRES = WL_SPACE .
          IF SCREEN-GROUP1 = WL_XYZ.
            CLEAR : P_RESNM, P_NOB.
            SCREEN-ACTIVE = 0.
            MODIFY SCREEN.
          ENDIF.
        ELSE.
          SCREEN-ACTIVE = 1.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.

  • How to set a default values on fields

    Hi !
    using Jdeveloper:11.1.1.4.0
    ADF Business Components     11.1.1.59.23
    Jsp page
    I want to set a default Date value in the field (in search form) How to do this ? Img priview [http://tinypic.com/r/zjhuf9/6]
    The default value need to be one week older that today priview Default value: 07.08.2012 (14.08.2012:Today)
    and a user cannot change that value
    I am newbie in ADF and Java so some usefull links can be posted to
    ID

    Hi,
    Adding default value for the attribute would work for the new rows that are created. If you want to have that in the search field, you need to set the default value for the bind variable which you are using in your View Criteria. The blog i've posted serves exact same usecase as yours.
    -Arun

Maybe you are looking for

  • APP copyright question

    I have not read any of the APPS EULA's nor do I know where they are. I am curious about buying an app (from itunes on the computer, NOT the itunes app on the phone) and installing it on more than one phone, if it even can be done. My wife will get an

  • I am trying to sync my iphone to my computers libary

    When I go to do so - I recieve this message : Error - Itunes requires a newer version of Apple Mobile Device Support. Please uninstall both Apple Mobile Device Support and Itunes. Then reinstall itunes again. Firstly, All I want is the new songs I ju

  • Major SSD crash

    My startup SSD crashed while using FCP X. FCP X was getting slower and slower as it tried to deal with thousands of clips in a project which were the result of thousands of time code breaks. Fast forwarding and rewinding the tape got rid of a few hun

  • CUPS 6.0.6 Exchange Calendar Integration Configuration

    Just setting up a connection from CUPS 6.0.6 to our exchange 2003 deployment.  Following the Cisco Unified Presence Deployment Guide Release 6.0(1) for setting up the configuration. We run OWA internally without any SSL certs, and externally using SS

  • Restrict Workflow Administrator responsibility for a business group

    My requirement is to restrict the Workflow Administrator responsibility to a specific business group so that the administrator can view all notifications/transactions for a given business group only for ALL item types. I tried following the steps giv