How to set primary key for a date column

hello experts .,
i need to set primary key for a column consists of the datatype date. how to solve this..?

1008318 wrote:
its my personal need..then it is a very bad personal need. DATE is not an appropriate type to be using for a primary key, as it cannot be guaranteed to be unique, especially when inserting multiple rows at once.
You would be better working to business needs and implementing correct technical solutions to those needs, than to just do things based on your personal needs.

Similar Messages

  • How to set null value for a date column using database adapter

    Hello,
    I have a table wih 3 columns
    (id NUMBER,
    modified_on DATE
    contentText VARCHAR2)
    I have a row wih theses values (1, 20/03/2010 16:30, 'coucou')
    I want use a DB adapter in a BPEL process to change the value of column modified_on to (null). I'm using the out-of-he box "update" method (no custom sql, nieher "insert or update (merge)" method)
    - If I only set values of "Id" and "contentText" -> insert is done but I missed the modification of "modified_on" to (null)
    - If I set all values and use expression '' (2 single quote without any space) for modified_on I got an error on update
    BWriteInteractionSpec Execute Failed Exception.
    update failed. Descriptor name: [DBUTFORM.TForm]. [Caused by: String index out of range: 10]
    Caused by Exception [TOPLINK-3001] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070608)): oracle.toplink.exceptions.ConversionException
    Exception Description: The object [xs:datetime], of class [class java.lang.String], could not be converted to [class java.sql.Timestamp].
    Internal Exception: java.lang.StringIndexOutOfBoundsException: String index out of range: 10.
    Thanks for help

    1008318 wrote:
    its my personal need..then it is a very bad personal need. DATE is not an appropriate type to be using for a primary key, as it cannot be guaranteed to be unique, especially when inserting multiple rows at once.
    You would be better working to business needs and implementing correct technical solutions to those needs, than to just do things based on your personal needs.

  • How to set primary key of the VO.

    I have a problem with the master detail search. The search works fine on the first search, all details can be seen fine, but in the second search I get this error.
    The number of displayed records, 1, exceeds the actual number of records, 0, in view object EgoItemAdvancedSearchAM.MYACCESSOR001_MYLINK001_DetailsOrderLinesVO. Some of the displayed records may have been deleted.
    Somwhere in another thread, someone had the same problem and the soultion was to set primary key of the master VO. I am not sure how to set primary key of a VO. In my case the master VO is dynamic. Is there a way I can set PK of a dynamic VO.
    Any help greatly appreciated.

    Hi
    Thanks for your reply...
    am seting the primary key to VO attribute in my controller(PR)...but its not mapping to the VO attribute..
    OAAttachmentImageBean Ibean = (OAAttachmentImageBean)webBean.findChildRecursive("OpAttachments");
    String[] pkvaule = {"ResAttribute15"};
    Ibean.setPkColumns(pkvaule);
    Regards
    Harrrry

  • How to set Shortcut keys for button in Apex

    Hi
    Could anyone help me on how to set shortcut keys for buttons in Apex.
    I need to use say ALT + S to submit the page.
    The following thread pertaining to HTML DB refered to use ACCESS key. but that couldnt work in my case.
    Re: operation of the app. with the keyboard
    Any pointers on achieving this would be helpful.
    Thanks
    Vijay

    Hi Vijay,
    I’m afraid you must do it using javascript key listener. You can’t use action() on template based buttons because they are actually not HTML buttons but images with hyperlink.
    Key listener checks which key has been pressed down and invoke some JS function. For example, write this code in page header:
    <script>
    document.onkeydown=keyCheck;
    function keyCheck(e){
         var KeyId = (window.event) ? event.keyCode : e.keyCode;
         switch(KeyId){         
              case 113:
                   doSubmit('SAVE');
                   break;                    
              case 118:
                   alert('Hello');
                   break;
    </script>
    This script will submit page with request 'SAVE' if you press F2 or will show alert message if you press F7. Modify it to your issue.
    Regards,
    Przemek

  • How to find Primary Key for a particular SAP Databse Table?

    Hi Guys,
                  How to find Primary Key and foreign key  for Particular SAP Databse table ?for Ex : EKKO , EKPO , EKKN , EKBE , EKBEH  , EKET and EKETH.
    Thanks,
    Srinivas.

    Use transaction SE11 to display the table. Put the cursor on the field you want to display the check table and click 'Foreign key' push button (a key with an bottom point arrow), then it will show the check table of the foreign of a field.
    Or by just simple double click on the field, a pop-up window of all the attribute (including the foreign key and the check table if exists) will show too.
    <i><b>Please reward point for helpful answer.</b></i>
    Minami

  • How to genarate Primary Key for each record in XI  Mapping

    Hi,
    I need to genarate primary key for each record in the paylod in mapping..
    Eg: if i have a 10 reacords i need to have a primary key for each record..starting with the
    Record      Primary key
    First            001
    Secound      002
    Tenth         010
    If i need to write any user defined funtion... can any one provide the code for it.
    Thanks
    Amaresh

    Hi Bavesh,
    I will explain with the example:
    XML:
    <Record 1>
    <Primary key>
    <value1>
    <value2>
    </Record 1>
    <Record 2>
    <Primary Key>
    </Record 2>
    like above i will be getting n number of recored and in each record i need  to genarate primary key in XI.and the key sould be in sequence...
    like for the first record 1 secound 2 like that primary key should add to the privous Primary key.
    and this is for each payload.
    Thanks
    Amaresh

  • How to add primary key for table with existing data?

    The table is occupied data already. There was no primary key before, so for every column, there are some duplicate values.
    I want to add a new column, which should be of the datatype integer, and can automatically increment, starting from 001. I tried this in Oracle SQL Developer, but it says "ORA-01758: table must be empty to add mandatory (NOT NULL) column". How can I do it? Thanks!

    Hello, don't call the column ID, that could be an ID relating to anything. Perhaps be a little more specific like emp_id .
    Then to update it:
    UPDATE Employee emp
      SET emp_id = (
      SELECT row_num
        FROM (
      SELECT ROWID,
                 ROW_NUMBER() OVER (ORDER BY ROWID) row_num
        FROM Employee emp2) emp2
      WHERE emp.ROWID = emp2.ROWID);That will assign a new EMP_ID for each, beginning at 1.
    Then:
    ALTER TABLE Employee MODIFY emp_id NOT NULL;
    ALTER TABLE Employee ADD CONSTRAINT EMP_PK PRIMARY KEY (EMP_ID);Then create a sequence for future population of the Employee table:
    CREATE SEQUENCE emp_seq START WITH <maximum value of emp_id + 1>;

  • How to set title/text for ALV table column header in WD ABAP

    Hello,
    I am working in WDA using SALV_WD_Table to display data in table. I need to change the column header text, the obvious way is to get the column header and call the method SET_TEXT to set new text / title. However, this method does NOT work, it does not change the column header text. I also tried the SET_TOOLTIP, this one works, but SET_TEXT does not work. Anyone has idea why this not working and do you find any go-around solution?
    My version is NW 7.0
    Thank
    Jayson

    Hi jason ,
    For setting Heder text for your ALV table
    ip_confing type ref to CL_SALV_WD_CONFIG_TABLE.
    "set alv table header
      ip_config->if_salv_wd_table_settings~r_header->set_text( 'Test ALV Header functionality' ).
    first you have to hide the DDIC text and then try to set your own text .
    "modify columns
      LOOP AT lt_columns INTO ls_column.
        lr_column = ls_column-r_column.
        CASE ls_column-id.
          WHEN 'MANDT'.
            "hide this field
            lr_column->set_visible( cl_wd_abstr_table_column=>e_visible-none ).
           WHEN 'SEQNR'.
            "set header to different string
            lr_column->r_header->set_ddic_binding_field( if_salv_wd_c_column_settings=>ddic_bind_none )." use this line to hide ddic text
            lr_column->r_header->set_text( 'Position' ).     
        endcase.
      endloop.
    Regards
    Chinnaiya P

  • How to set Right Alignment for a JTable column

    Hi,
    I am using a JTable for displaying database records using AbstractTableModel. It works fine. But, for the numeric fields I want to make records right aligned using setHorizontalAlignment. I tested with TableColumn.setHorizontalAlignment but it ends up with an error. Is there a solution? Please help me. Thanks in advance.
    bhuvana.

    In you table cell renderer you can specify the alignment of the text.
    public class MyTableCellRenderer extends JLabel implements TableCellRenderer
    public MyTableCellRenderer
    setOpaque(true);
    setBackground(Color.white);
    public Component getTable.....(JTable table,Object value,......) //fill all these things
    setFont(table.getFont());
    if(value instanceof Float)
    setHorizontalAlignment(SwingConstants.RIGHT);
    setText(value);
    return this;
    This would set all the Floats to RIGHT alignment.
    Thanks,
    Kalyan

  • How can i set primary key after creating a table ?

    hi friends
    thank you for all the support you have given me . i have doubt ,can we set primary key for a column after creating the table
    I have added a column named idno after creating the table . i want to set that column as primary key . i tried this
    table name = address
    column name = idno
    ALTER TABLE ADDRESS MODIFY (idno PRIMARY KEY(idno))
    ,but not working
    if anbody knows the solution pls reply
    thanks and regards
    nev

    how does the other users know which is the primary key for this table?....the other user needs to execute this query...and modify the query accordingly
    select aa.table_name,aa.column_name,aa.constraint_name,bb.constraint_type
    from user_cons_columns aa,user_constraints bb
    where aa.constraint_name = bb.constraint_name
    and aa.table_name = 'TEST_EMP' and bb.constraint_type = 'P';

  • How to set up Deltas in FI data sources

    How to set up deltas  for FI Data sources & can any body give me the list of the Finance data sources...
    please help me..

    Standard FI data sources:
    0FI_GL_4 (G/L Accounts- line items)
    Takes the data from the FI document tables (BKPF/BSEG) that are relevant to general ledger accounting (compare table BSIS).
    0FI_AP_4 (AP-line items) and 0FI_AR_4 (AR- line items
    Selections are made from tables BSID/BSAD (Accounts Receivable) and BSIK/BSAK (Accounts Payable)
    How the data extraction happens?
    In FI extraction 0FI_AR_4 and 0FI_AP_4 are linked with 0FI_GL_4 in order to maintain consistent data transfer from OLTP system (it is called coupled data extraction, Ref OSS notes 428571).
    Note: Uncoupled" extraction possible with Plug-In PI 2002.2, see OSS note 551044
    0FI_GL_4 writes the entries into the time stamp table BWOM2_TIMEST in the SAP R/3 System with a new upper limit for the time stamp selection.
    And now, 0FI_AP_4   and 0FI_AR_4 will copy this new upper limit for the time stamp selection during the next data extraction in the SAP R/3 System. This ensures the proper synchronization of accounts payable and accounts receivable accounting with respect to G/L accounting.
    Full load: Not a valid choice because of large volumes of detailed R/3 transaction data.
    Delta load:
    Note: Here the delta identification process works differently for new financial records and for changed financial records.
    New Financial accounting line items which are posted in SAP R/3 sytem will be identified by the extractor using the time stamp in the document header (Table BKPF-(field) CPUDT).
    By scheduling an initialization IP all the historical data can be  loaded into BW from the application tables and it also sets "X" indicator in field LAST_TS (Flag: 'X' = Last time stamp interval of the delta extraction).That means after the last delta, initialization was done.
    OLTPSOURCE     AEDAT/AETIM     UPD     DATE_LOW     DATE_HIGH     LAST_TS
    0FI_GL_4     16 May 2007/20:15     Init     01 Jan 1990     15 May 2007     
    0FI_GL_4     24 May 2007/16:59     delta     16 May 2007     23 May 2007     
    0FI_GL_4     21 June 2007/18:12     delta     15 June 2007     20 June 2007     X
    0FI_AP_4     18 May2007/21:23     Init     01 Jan 1990     15 May 2007     
    After this, daily delta loads can be carried out depending on timestamp by scheduling delta info packages.
    During the delta load , the SAP R/3 system logs two time stamps that delimit a selection interval for a Data Source in table BWOM2_TIMEST(fields TS_LOW and TS_HIGH).
    FI -Delta Mode:
    A time stamp on the line items serves to identify the status of the delta. Time stamp intervals that have already been read are then stored in a time stamp table (BWOM2_TIMEST).
    (Info object 0Recordmode plays vital role deciding delta's .Check the field "delta "in ROOSOURCE /RODELTAM table to identify the image)
    The Financial Accounting line items are extracted from the SAP R/3 system in their most recent status (after-image delta method).
    AIE: This delta method is not suitable for filling Info Cubes directly in the BW system. To start with therefore, the line items must be loaded in the BW system in an ODS object that identifies the changes made to individual characteristics and key figures within a delta data record. Other data destinations (Info Cubes) can be provided with data from this ODS object.
    It uses delta type E(pull) means the delta data records are determined during the delta update by the data source extractor, updated to the delta queue and passed on to BI directly from there.

  • How do i set Shortcut key for activating some operation for JButton

    while using the JButton component,one question is arising in my mind that is
    (1)how to set Shortcut key instead of using JButton actionPerformed event.
    I need a shortcut key for the similar operation has to be performed

    http://java.sun.com/docs/books/tutorial/uiswing/components/button.html

  • Setting a Primary Key for a newly added Column

    Is it possible for setting a primary key for a newly added column in a table having records?

    Hi,
    km**** wrote:
    oh if the table has records then it is not possible ah...No, the table can have rows at the time you add the Primary Key constraint. Solomon was just saying that the column(s) that you are making into the Primary Key must already have unique values. A Primary Key can not be NULL, so you must do the steps in this order:
    (1) ALTER TABLE to add the column(s) (if this hasn't been done already)
    (2) UPDATE the table, to put unique values in all rows for the Primary Key column(s)
    (3) Add the PRIMARY KEY constraint
    You need to do step (2) before you do step (3)

  • How to change primary keys of existing InfoCube.

    Greetings everyone!
    I’m trying to change the Key Fields in my reporting architecture as per our new company mandate.  I’ve been able to successfully change the primary keys for DS, DSO and InfoSource.  Can any kind soul out there please tell me how to change the primary keys on an existing InfoCube?  I will surely appreciate all the assistance I can get.  Its kinda urgent!
    Regards,
    Philips

    Hi,
    Check the possibility with Remodelling option . If it is not possible with Remodelling, then you can only change the cube deleting the Data.
    With rgds,
    Anil Kumar Sharma .P

  • Setting primary key fields from sequence. Please advise

    What is the most logical place to automatically set primary key fields from
    sequence?
    jdoPrestore seems to be a little late - my instance will not have id till
    it's committed. I can not do it in constructor because it gets called every
    time Kodo needs to construct an instance. What other options do I have for
    automatic pk assignment except do it in my code (hate it)?
    I wish I could use store managed OIDs but I need access to OID underlying
    data
    Please also see my previous message "Application Identity Extention"

    I came up with following pattern:
    public class OrgUnit implements InstanceCallbacks {
    private long orgUnitId = -1;
    private transient long tempOrgUnitId = -1;
    public long getOrgUnitId() {
    if (orgUnitId < 0) {
    if (tempOrgUnitId < 0) {
    tempOrgUnitId = JDOFactory.getNextSequenceId(getClass());
    return tempOrgUnitId;
    } else {
    return orgUnitId;
    public void jdoPreStore() {
    if (!JDOHelper.isDeleted(this)) {
    if (orgUnitId < 0) {
    setOrgUnitId(getOrgUnitId());
    I use -1 as an indicator that ID has not been assigned yet. If you use Long
    instead of long it will be cleaner since we can test for null
    "Alex Roytman" <[email protected]> wrote in message
    news:9q27co$r35$[email protected]..
    What is the most logical place to automatically set primary key fieldsfrom
    sequence?
    jdoPrestore seems to be a little late - my instance will not have id till
    it's committed. I can not do it in constructor because it gets calledevery
    time Kodo needs to construct an instance. What other options do I have for
    automatic pk assignment except do it in my code (hate it)?
    I wish I could use store managed OIDs but I need access to OID underlying
    data
    Please also see my previous message "Application Identity Extention"

Maybe you are looking for