Attachment Table - Primary Key in CO

How can I add dynamically the primary key VALUE to an attachment table in CO processRequest??
Thanks!
Edited by: user12190100 on Apr 12, 2010 1:43 PM

Yes Fact Table can have a Primary key
But in your case it looks like the Other Table which is storing Day to Day transaction should be made FACT , and the one you are calling FACT should be made Dimension..
Well depends again, how you are analysing data and against which attributes
Thanks
Ashish

Similar Messages

  • TIPS(9):PARENT-CHILD(FOREIGN KEY) 관계를 갖는 MASTER TABLE의 PRIMARY KEY 확인.

    제품 : SQL*PLUS
    작성날짜 : 1996-10-21
    TIPS(9) : PARENT-CHILD관계를 갖는 TABLE의
    PRIMARY key, FOREIGN key의 COLUMN 명과 POSITION 확인
    ==============================================================
    ** Name : Show_Position.Sql
    ** Usage : @Show_Positions Parent_Table Child_Table
    ** Description : Shows Primary And Foreign Key Positions
    ** WARNING : 이 문장은 해당 Table의 Constraint생성시 Naming
    ** Convention을 따른 경우에 적용되도록 되어 있다.
    SET VERIFY OFF
    CLEAR BREAK
    BREAK ON CONSTRAINT_NAME ON TABLES
    SELECT SUBSTR(CONSTRAINT_NAME,1,27) CONSTRAINT_NAME,
    SUBSTR(TABLE_NAME,1,15) TABLES,
    SUBSTR(COLUMN_NAME,1,15) COL_NAME,
    SUBSTR(POSITION,1,3) POSITION,
    SUBSTR(OWNER,1,7) OWNER
    FROM USER_CONS_COLUMNS
    WHERE TABLE_NAME = UPPER('&1')
    AND CONSTRAINT_NAME LIKE 'PK%'
    UNION
    SELECT SUBSTR(CONSTRAINT_NAME,1,27) CONSTRAINT_NAME,
    SUBSTR(TABLE_NAME,1,15) TABLES,
    SUBSTR(COLUMN_NAME,1,25) COL_NAME,
    SUBSTR(POSITION,1,3) POSITION,
    SUBSTR(OWNER,1,7) OWNER
    FROM USER_CONS_COLUMNS
    WHERE TABLE_NAME = UPPER('&2')
    AND CONSTRAINT_NAME LIKE 'FK%'
    ORDER BY 1 DESC , 4 ASC;
    < 실행 예 >
    SQL> @SHOW_POSITIONS EMP_SERVICE EMP_SERVICE_LOG
    CONSTRAINT_NAME TABLES COL_NAME POS
    PK_EMP_SERVICE EMP_SERVICE EMP_ID 1
    CUST_ID 2
    FK_EMP_SERVICE_LOG_EC EMP_SERVICE_LOG EMP_ID 1
    CUST_ID 2

    제품 : SQL*PLUS
    작성날짜 : 1996-10-21
    TIPS(9) : PARENT-CHILD관계를 갖는 TABLE의
    PRIMARY key, FOREIGN key의 COLUMN 명과 POSITION 확인
    ==============================================================
    ** Name : Show_Position.Sql
    ** Usage : @Show_Positions Parent_Table Child_Table
    ** Description : Shows Primary And Foreign Key Positions
    ** WARNING : 이 문장은 해당 Table의 Constraint생성시 Naming
    ** Convention을 따른 경우에 적용되도록 되어 있다.
    SET VERIFY OFF
    CLEAR BREAK
    BREAK ON CONSTRAINT_NAME ON TABLES
    SELECT SUBSTR(CONSTRAINT_NAME,1,27) CONSTRAINT_NAME,
    SUBSTR(TABLE_NAME,1,15) TABLES,
    SUBSTR(COLUMN_NAME,1,15) COL_NAME,
    SUBSTR(POSITION,1,3) POSITION,
    SUBSTR(OWNER,1,7) OWNER
    FROM USER_CONS_COLUMNS
    WHERE TABLE_NAME = UPPER('&1')
    AND CONSTRAINT_NAME LIKE 'PK%'
    UNION
    SELECT SUBSTR(CONSTRAINT_NAME,1,27) CONSTRAINT_NAME,
    SUBSTR(TABLE_NAME,1,15) TABLES,
    SUBSTR(COLUMN_NAME,1,25) COL_NAME,
    SUBSTR(POSITION,1,3) POSITION,
    SUBSTR(OWNER,1,7) OWNER
    FROM USER_CONS_COLUMNS
    WHERE TABLE_NAME = UPPER('&2')
    AND CONSTRAINT_NAME LIKE 'FK%'
    ORDER BY 1 DESC , 4 ASC;
    < 실행 예 >
    SQL> @SHOW_POSITIONS EMP_SERVICE EMP_SERVICE_LOG
    CONSTRAINT_NAME TABLES COL_NAME POS
    PK_EMP_SERVICE EMP_SERVICE EMP_ID 1
    CUST_ID 2
    FK_EMP_SERVICE_LOG_EC EMP_SERVICE_LOG EMP_ID 1
    CUST_ID 2

  • Getting error message when passing data into table: Primary Key

    Getting an error in a process that is feeding the invoice creation in SAP, violation of PRIMARY KEY constraint 'INV1_Primary', cannot insert duplicate key in object 'INV1'. I assume this is due to duplicate key values being passed into the table INV1, however I get this error even when I am passing unique record combinations of the key fields docentry and linenum. This is on 2005A SP01.
    Thanks

    Hi Peter,
    Could you provide a code sample of the routine that is causing the error please?
    It sounds like a data corruption issue (though it could possibly be a bug in the DI API). I recommend you speak to SAP support. There is a utility that can validate the document numbering but you'll need to speak to SAP support before you run this as it can have other negative effects, depending on the state of your data. They may ask for a copy of your database to test.
    Kind Regards,
    Owen

  • Updating a transparent table primary key

    Hi Guys,
                  I am fixing a system copy error, for that plan to update the table through a program.
    The field I am going to update one of the primary key field.
    Is that possible to do it.
    Thanks

    Hi,
      if you are going to insert a record it is possible.
    if you are going to modify the existing record it is not possible to update the primary key you can only change the fields which are not primary key.

  • Tables-Primary Key-Sequential read

    Hi Folks,
    Out of the following which imporves performace?
    1.Using all the primary keys of a table in the where clause of a select statement?
    2.Using any one or two (not all) primary keys of a table in the where clause of a select statement?
    Let me the know the same in the case of using an Secondary index.
    3.If we follow the second one,then it will go for a sequential read,how this sequential read mars the performance?
    4.How creating an index will affect the database as BASIS guys are not in favour to creating an index.
    Thanks,
    K.Kiran.

    1.Using all the primary keys of a table in the where clause of a select statement?
    2.Using any one or two (not all) primary keys of a table in the where clause of a select statement?
    Out of the above 2 first one will give more performance. Coming to primary key or Secondary indexses, anything.. it gives better performance if you give the key fileds in the order of DB declaration.
    I mean you are specifying some fields of primary key.. but not in the order .. i mean u have specified key1, key3, key4. It will give less performance than specifying only key1 and key2.
    in secondary indexes if you are not specifying all key completely that will take the key up to the order matches. i mean in key1, key3, key4 case.. it will consider only Key1.
    In Key1, Key2 case it will consider both.
    3.If we follow the second one,then it will go for a sequential read,how this sequential read mars the performance?
    4.How creating an index will affect the database as BASIS guys are not in favour to creating an index.
    Creating an secondary index will save the table contents in the format of starting with index fields in the DB. So number of indexes on the same table will need to craete more views in database. So leads to poor DB performance. i mean more space unnecesarily for a single table. That's why they will create indexes only for very frequently used fields on tables.

  • Odi-target table-primary key

    hi,
    is it compulsory to have a primary key constraint in the target table in odi.
    Can we have a target table without any primary key constraint?

    Hi,
    Yes u can have target table without PK.
    Only for IKM Incremental Update u need to define Update key (which may not be persist in back end). For IKM Control append u no need to have PK defined.
    Thanks,
    Guru

  • OMPLUS retrieve table primary key column

    I'm trying to retrieve the primary key column associated with a table via OMBPLUS.
    The following command successfully returns the PK name
    OMB+> OMBRETRIEVE TABLE 'ODS_REGION' GET PRIMARY_KEY
    REGN_PKWhen I add the GET COLUMNS clause (as per API documentation), I'm still only getting the pk name.
    OMB+> OMBRETRIEVE TABLE 'ODS_REGION' GET PRIMARY_KEY GET COLUMNS
    REGN_PKAny suggestions on what I might be doing wrong?

    Worked it out. Syntaxt needed is:
    OMBRETRIEVE TABLE 'ODS_REGION' PRIMARY_KEY 'REGN_PK' GET COLUMNS
    (no GET between table name and PRIMARY_KEY clause)

  • Large table, primary key constraint

    I have migrated a table from 8i to 9i that is over 300 million rows. I migrated the the table to a 9i database without constraints or indexes.
    I have successfully created a composite index of two columns, t1 varchar2(512), t2 varchar2(32). This index took nearly 16 hours to create.
    I am now trying to create a primary key based on that index with the following sql:
    alter table table1
    add constraint table1_t1_t2_pk primary key(t1,t2)
    using index table1_t1_t2_idx
    nologging
    This process has taken over 24 hours and is well into the second day. Studio reports it will take an additional 15 hours to create.
    My questions are these?
    1. Is my syntax okay?
    2. I thought that by creating a primary key on an existing index, that another index is not being created. I thought it would be faster this way. Why is it taking a lot longer to create then the index it is based upon?
    3. Is there a more efficient method (other than parallel query) to create this index/constraint on such a large table? What happens when I go production and need to recreate this index if I have a failure. I have never had to do this before. I can't be down for 48 hours to create an index. What other alternatives do I have?
    The table is partit[i]Long postings are being truncated to ~1 kB at this time.

    Is INDEX table1_t1_t2_idx UNIQUE? If it's not that might explain why building the primary key constraint takes longer.
    I think the USING INDEX clause with an existing index is intended mainly for different UNIQUE constraints to share the same index. In your situation I think you would be better off just building the primary key constraint.
    Cheers, APC

  • Query not using remote table primary key.

    Hello all,
    My following query is not using the PK of remote database. vem_business_event_attribute is having a PK on ATTRIBUTE_TYPE_ID and business_event_id. The table is last analyzed on 04-dec-2010. It has around 5 milloin rows.
    select /*+ DRIVING_SITE(ve) */
    ve.ATTRIBUTE_TYPE_ID ,
    ve.BUSINESS_EVENT_ID ,
    ve.ATTRIBUTE_VALUE ,
    ve.ATTRIBUTE_AS_NUMBER
    from
    vem_business_event_attribute@hello ve,
    vem_attribute_types@hello va,
    delta_insert_businessevent de
    where
         ve.ATTRIBUTE_TYPE_ID = va.ATTRIBUTE_TYPE_ID
    ve.business_event_id = de.business_event_id
         and de.business_event_id < 90000000;
    Pls help.
    Regards

    If you need to move 150 million rows from one database to another, it is going to take some time, and a full scan would definitely be the most efficient sql way to do it. I would be surprised if 15 inserts of 10 million rows each would be faster than a single insert of 150 million rows.
    Depending on your exact requirements, it might be faster to use datapump to export the rows from the remote database and import them on the local database, but you will still be moving those 150 million rows across the network. You might get some advantage from the export/ftp/import option if you compress the dump file before the ftp, and uncompress it on the target, but that would depend on the additional time required to compress and uncompress.
    John

  • Problem with inserting into table that has autogenerated primary key

    hi
    i am working on EJB3.
    i am trying to insert object into table.Primary key of table will be generated automatically.I tried following statement for insertion,
    em.persistent(customerObj);
    but it throw following exception,
    javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): customer.CustomerInfo
         at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
         at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
         at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
         at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:211)
         at org.jboss.ejb3.stateless.Stateles
    can anyone tell me is there any other way to acheive the same.
    i thought of doing using insert query,but i am not sure about the syntax to be used.
    could anyone help me ?
    thanks in advance...

    That's why you should use PreparedStatement instead of Statement. Its setString() method will escape that value for you properly when you bind it.
    %

  • Problems whit primary key = '#'

    Hello!
    I've got a problem with an application based In Forms of a Table with Report when the table primary key has the value '#'.
    From the report, when I press the 'update' button, this value is contained in the URL link with de upddate form, but all the fields in the form appear empty, so I can't update or delete this row.
    form URL example https://servername/f?p=133:10:3953379412098904::NO::P10_ID_TRAMO_FACTURACION:#
    Table definition
    LK_DMR_TRAMOS_FACTURACION
    ID_TRAMO_FACTURACION VARCHAR2(1 BYTE) NOT NULL,
    DE_TRAMO_FACTURACION VARCHAR2(50 BYTE),
    DE_LIMITE_INFERIOR NUMBER(8, 0),
    DE_LIMITE_SUPERIOR NUMBER(8, 0),
    FC_ACTUALIZACION_DMR DATE DEFAULT SYSDATE,
    ID_USUARIO_ACT_DMR VARCHAR2(20 BYTE) DEFAULT USER
    , CONSTRAINT PK_DMR_TRAMOS_FACTURACION PRIMARY KEY
    ID_TRAMO_FACTURACION
    ;

    Hi,
    character # has special meaning when used in URL - http:/server/some.htm#text means "load page some.htm and jump to place where construction <a name="text"> was placed". If there's nothing after #, browser won't jump anywhere... But # character is lost anyway.
    Solution? You can escape this character and instead of # use %23 - http://server/apex/f?p=100:1:85284257448058::::P1_X:%23
    dino

  • About sequences substituting primary key values

    I've created trigger:
    TRIGGER EMPLOYEES_TRG BEFORE INSERT ON EMPLOYESS
    FOR EACH ROW
    BEGIN
    SELECT employees_seq.nextval
    INTO :new.nr
    FROM dual;
    END;
    following statement works just fine in SQL Worksheet:
    insert into employees(Name, Surname) values ('M','C')
    but when I try to make a swing client from application module using fields from entityView it seems that trigger doesn't fire as I commit. maybe the adequate statement
    generated using ADF Business components doesn't generate "employees(Name, Surname)"?
    The question is how to make my tables primary key get increased using trigger when I make a client form from two fields: Name, Surname and create and commit buttons.. ?

    HI Mario,
    your primary key in the entity object needs to be of DBSequence type.
    It will show as a negative number in the form but when doing a commit the Trigger will catch it and change the value to sequence number.
    Carl

  • Two foreign keys reference on primary key

    There are two tables:
    1) table CALENDAR with primary key: cal_id
    2) table FACTS with some columns, two of them are dates: cal_id_start_process, cal_id_stop_process
    we want on physical layer create two foreign keys for cal_id_start_process and cal_id_stop_process columns reference on CALENDAR.cal_id
    When we create foreign key for cal_id_start_process: we choose this column and choose CALENDAR table and its primary key. But when we want to create foreign key for cal_id_stop_process - we cannot coose table CALENDAR again.
    Is this rigth, that only one column from table can reference on specified primary key in CALENDAR table?
    How to create two foreign key on one table primary key?

    More complex. In your example there'll be such SQL:
    select c.cal_id, f.cal_id_start, f.cal_id_stop
    from CALENDAR c, FACTS f
    where c.cal_id = f.cal_id_start and c.cal_id = f.cal_id_stop
    (It meens FACTS.cal_id_start = FACTS.cal_id_stop )
    In my case, I want for such join:
    select c1.cal_id, c2.cal_id, f.cal_id_start, f.cal_id_stop
    from CALENDAR c1, CALENDAR c2, FACTS f
    where c1.cal_id = f.cal_id_start and c2.cal_id = f.cal_id_stop
    Edited by: annylut on Dec 22, 2011 3:33 PM

  • Modify the value of the primary key...

    Hi all,
    I have made a mistake in the design of the table......
    and it is too late to get it changed....
    I have set the wrong field as primary key...
    These fields (keys) need to be modify , since i ve set it as a key, when ever modify those fields using
    "MODIFY ZTABLE VALUE INT_TABLE . ", it create a new row into the table because i change the primary key value. Using "UPDATE ZTABLE ....." it doesnt works because the key's value has changed.
    Thank you very much friends...

    Hi Wong,
    If the primary key value does not exist then MODIFY statement creates a new record and if exists it modifies(updates)...
    So better change the Table Primary key and try to reapeat u r code...
    For changing the primary key just goto SE11 and just check the primary key which  u want to assign and uncheck the preivous one ( make sure the primary key on to first line) then save it and before activating goto<b> Utilities --> Database Utility --> activate and adjust database</b>
    Now u r table is activated without deleting previous data also...
    Regards,
    Sridhar

  • Transporting table entry with primary key 120 char

    Hi all,
    I have 2 separate questions which I feel are closely related.
    In the url:
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb6e446011d189700000e8322d00/content.htm
    It says:....
    <i>If the key length is greater than 120, there are restrictions when transporting table entries. The key can only be specified up to a maximum of 120 places in a transport. If the key is larger than 120, table entries must be transported generically.</i>
    <b>How do I transport the table entries "generically" for such a table?</b>
    To further illustrate my actual problem:
    My problem in the real world lies with the MIMETYPES table, maintained in trx SMW0.
    I select the mime types row by row and do a <u>Table Entry > Transport Entries,</u> but get an error that says
    <i>"Key entry for table MIMETYPES may only be generic"</i>.
    As a result it fails to attach to my transport.
    (Note: the primary key of MIMETYPES is 128 chars long)
    The Diagnosis long text says "<i>The key is longer than allowed by the Change and Transport System (120 characters</i>)."
    The Procedure says:
    <i>1.  Make sure that you only specify the character fields before the    
        first non-character key field. You must enter the key with a generic
        ending. Enter the generic symbol directly after the specified part 
        of the key.                                                                               
    2.  You must enter the generic symbol at the latest in the 120th       
        character of the key.                                              </i>
    <b>What is this generic symbol that i need to insert at the 120th position??</b>
    Message was edited by:
            Kevin Wong
    Message was edited by:
            Kevin Wong
    Message was edited by:
            Kevin Wong

    Thanks Nick!
    So the mysterious "generic character" is actually the asterisk (*). It works.
    Strange tho as the error long text says to insert the "generic character" at the 120th character position of the key, but I found that altho I can save it, the transport still fails with the same error.
    I tried placing the * right after the key value e.g.
    KEY123*
    and it worked.
    Thanks again!

Maybe you are looking for