Queston about CMR and corresponded database table.

Hi:
For example, If I have a EntityA with cmp field named "EntityA_ID" which is
the primary key field, and have a EntityB with cmp field named "EntityB_ID" which
is the primary key field. The relation of EntityA and EntityB is 1:1.
But the container will create table EntityA_Table and EntityB_Table:
CREATE TABLE EntityA_Table (ID varchar (50) PRIMARY KEY,_EntityA_EntityB
varchar(50))
CREATE TABLE EntityB_Table (ID varchar (50) PRIMARY KEY,_EntityB_EntityA
varchar(50))
But the column for relation is as same as the primary key column, the question
is below:
Q1: Does the cmp field and cmr field can not be the same database table column?
If so, it will waste the disk space.
Q2: which one is more common or more better?
1)create database table first and create CMP based on table.
2)create CMP first and create table from EJB descriptor thought EJB container
when deploying.
3)create CMP first and create table from EJB descriptor by manual.
Regards!
John Lee

The relation of EntityA and EntityB is 1:1.
But the container will create table EntityA_Table and EntityB_Table:
CREATE TABLE EntityA_Table (ID varchar (50) PRIMARYKEY,_EntityA_EntityB
varchar(50))
CREATE TABLE EntityB_Table (ID varchar (50) PRIMARYKEY,_EntityB_EntityA
varchar(50))
for 1:1 relationships, only one table is required to contain the Foreign
Key.
But the column for relation is as same as the primary key column, thequestion
is below:
Q1: Does the cmp field and cmr field can not be the same database tablecolumn?
If so, it will waste the disk space.The primary key cmp field column cannot be the same database column as the
foreign key cmr field column because the primary key cannot change value
once it is set whereas the foreign key may change according to how
relationships are made and broken.
Q2: which one is more common or more better?
1)create database table first and create CMP based on table.
2)create CMP first and create table from EJB descriptor thought EJBcontainer
when deploying.
3)create CMP first and create table from EJB descriptor by manual.
At development time allowing the container to create the tables is
convenient.
It is not recommended to rely on this mechanism for production use.
Generally,
one wants much more control over the database tables in production than the
simple things that the container does when it creates 'default' tables.
-thorick

Similar Messages

  • Browse and update database tables

    I'm looking for a tool that will let me connect to an Oracle database, select a table and some fields off the table and build a simple java class to navigate / update the data.
    Essentially, I'm looking for a tool that replicates the way Microsoft Access can build a form for navigation and update of a database table.
    However, I want to use java, not MS Access.
    Any ideas if such a tool is available ?
    Thanks

    http://squirrel-sql.sourceforge.net/

  • Thread pool and use database table as queue

    is this possible to use database table as queue rather than using "LinkedBlockingQueue"..and store in memory ? If yes, how do i serialized the task object into table and how to retrieve the task object back when need to be execute by executorservice..?

    cometta wrote:
    is this possible to use database table as queue rather than using "LinkedBlockingQueue"..and store in memory ? If yes, how do i serialized the task object into table and how to retrieve the task object back when need to be execute by executorservice..?From the sound of this I think BDLH is on the right track. I would think in terms of messaging with JMS. There is one potential pitfall you may have to work around. JMS does not guarantee the order in which messages will be extracted from the queue. If the order of messages is important that is a problem you'll have to solve.
    PS.

  • Deleting and updating database table

    hi all,
    i have to update the database table based on my internal table(both having same structure).
    my database has 2 records having a key field 1 and 2 respectively.(2 records)
    and my internal table has records with key fields 3, 4 and 5 respectively(3 records) .
    i want to delete all data from database table first..
    then i want to insert all the three records in the database table..
    finally i want my database to have 3 records with key fields 3, 4 and 5 respectively that are in the internal table
    what should be the correct way?

    Hi ,
    to delete all the records from dbtab
    DELETE dbtab.
    to update the database by using internal table
    -MODIFY dbtab       FROM TABLE itab.
    but as per my knowledge structures of internal table and database table should be same
    if the database table is a Ztable please change the structure of database table as you said
    Put fields 3,4and 5 as key fields
    Thanks & Regards,
    Sateesh.

  • CMR and multiple databases

    Is it possible as when 2 entities are involved in a CMR relationship, one of the entities to take its data from one database and the other one from a different database ?
    Regards,
    Marius

    > So PEQ 200 and 300 access database 1, PEQ 250 accesses database 2, and PEQ 260 accesses database 3.
    >
    > I only want to know if this is possible and if so how would you set it up.  I do not want to get into any discussion on whether this is the best way to go or not.  Any pointers to OSS notes on the subject are more than welcome.
    Simple answer: No.
    Long answer:
    - Workprocesses don't know anything about "clients". A client is nothing more than an additional field in a table with the client number. So it's not possible to configure them to connect to a certain database using a "client number".
    - A client alone has nothing but application data. It has no dictionary (tables, views) and it has no repository (source code) that can be executed
    - A SAP system (ABAP) has cross client customizing that would need to be shared somehow, technically not possible since also here the workprocess (which is the lowest unit) does not know whether a table is client dependent or not.
    Maybe there is a way to come out of this dilemma - if you tell us, what you (business) requirement is.
    Markus

  • Error while setting up connection and adding database Tables

    Error 1
    The name 'My' does not exist in the current context
    C:\Users\levent 1\documents\visual studio 2010\Projects\DBCustomAction\DBCustomAction\VbDeployInstaller.cs
    53 37
    DBCustomAction
    Error 2
    The name 'Interaction' does not exist in the current context
    C:\Users\levent 1\documents\visual studio 2010\Projects\DBCustomAction\DBCustomAction\VbDeployInstaller.cs
    75 5
    DBCustomAction
    Error 3
    'System.Collections.Specialized.StringDictionary' does not contain a definition for 'Item' and no extension method 'Item' accepting a first argument of type 'System.Collections.Specialized.StringDictionary' could be found (are you missing a using directive
    or an assembly reference?) C:\Users\levent 1\documents\visual studio 2010\Projects\DBCustomAction\DBCustomAction\VbDeployInstaller.cs
    84 36
    DBCustomAction
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Configuration.Install;
    using System.Linq;
    using System.IO;
    using System.Reflection;
    using System.Data.SqlClient;
    namespace DBCustomAction
        [RunInstaller(true)]
        public partial class VbDeployInstaller : System.Configuration.Install.Installer
           System.Data.SqlClient.SqlConnection masterConnection = new System.Data.SqlClient.SqlConnection();
    public VbDeployInstaller() : base()
    //This call is required by the Component Designer.
    InitializeComponent();
    //Add initialization code after the call to InitializeComponent
    private string GetSql(string Name)
    try {
    // Gets the current assembly.
    Assembly Asm = Assembly.GetExecutingAssembly();
    // Resources are named using a fully qualified name.
    Stream strm = Asm.GetManifestResourceStream(Asm.GetName().Name + "." + Name);
    // Reads the contents of the embedded file.
    StreamReader reader = new StreamReader(strm);
    return reader.ReadToEnd();
    } catch (Exception ex) {
    throw ex;
    private void ExecuteSql(string DatabaseName, string Sql)
    System.Data.SqlClient.SqlCommand Command = new System.Data.SqlClient.SqlCommand(Sql, masterConnection);
    // Initialize the connection, open it, and set it to the "master" database
    masterConnection.ConnectionString = My.Settings.masterConnectionString;
    Command.Connection.Open();
    Command.Connection.ChangeDatabase(DatabaseName);
    try {
    Command.ExecuteNonQuery();
    } finally {
    // Closing the connection should be done in a Finally block
    Command.Connection.Close();
    protected void AddDBTable(string strDBName)
    try {
    // Creates the database.
    ExecuteSql("master", "CREATE DATABASE " + strDBName);
    // Creates the tables.
    ExecuteSql(strDBName, GetSql("sql.txt"));
    } catch (Exception ex) {
    // Reports any errors and abort.
        Interaction.MsgBox("In exception handler: " + ex.Message);
    throw ex;
    public override void Install(System.Collections.IDictionary stateSaver)
    base.Install(stateSaver);
    AddDBTable(this.Context.Parameters.Item("dbname"));

    Hi osmniv,
    I tested the code, it has three error when compiling.
    Error 1 The name 'My' does not exist in the current context C:\Users\levent 1\documents\visual studio 2010\Projects\DBCustomAction\DBCustomAction\VbDeployInstaller.cs 53 37 DBCustomAction
    In C#, there is no "My" key word, you need to use this method to use the settings.
    http://msdn.microsoft.com/en-us/library/aa730869(v=vs.80).aspx
    masterConnection.ConnectionString = Properties.Settings.Default.masterConnectionString;
    Error 2 The name 'Interaction' does not exist in the current context C:\Users\levent 1\documents\visual studio 2010\Projects\DBCustomAction\DBCustomAction\VbDeployInstaller.cs 75 5 DBCustomAction
    You need to add these references to the project, Microsoft.VisualBasic,
    Microsoft.Expression.Interactions AND System.Windows.Interactivity.  Right click on the project, choose the add -> reference -> choose the references.
    then, add the using statement:
    using Microsoft.VisualBasic;
    Error 3
    'System.Collections.Specialized.StringDictionary' does not contain a definition for 'Item' and no extension method 'Item' accepting a first argument of type 'System.Collections.Specialized.StringDictionary' could be found (are you missing a using directive
    or an assembly reference?) C:\Users\levent 1\documents\visual studio 2010\Projects\DBCustomAction\DBCustomAction\VbDeployInstaller.cs
    84 36
    DBCustomAction
    In C#, you could use the Parameters["dbname"] to get the indexer of element directly.
    AddDBTable(this.Context.Parameters["dbname"]);
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Can moving large sharepoint lists to database and using database table as an external list help performance?

    Hi All,
    I have to maintain a huge SharePoint 2010 list with more than 700,000 items in it. The items are data records(not documents) and are distributed among a number of folders. There are also a number webparts that are currently using this list. As you can imagine
    the performance of queries on the list have degraded considerably. Even opening the folders with too many items in them takes quite some time. We are looking for a solution for this situation and some people suggested to move the list items to a SQL Server
    table and make an external list representing the original list. They think this way the changes that we have to make in the webparts source codes will be minimal.
    I am not sure if this is the best solution as I have heard about slow external lists. Do you think using the external list instead of our current list improves the performance? Do you think this is the right solution for us?
    I would be grateful if you tell me your ideas to solve this problem.
    Thanks in advance

    "right solution for us" is hard to solve without more info.
    SharePoint list items can include things like version history, content approval, audit tracking, and more... such things are NOT built into SQL.
    BCS is an option, and generally changing a list CAN have a very minimal impact (making many assumptions about how it's used)...
    BCS also incurs an overhead of the lookup (since it's external). And there are record limits (defaults at a minimum).
    And more importantly, SharePoint *can* handle large lists... if done appropriately... but can also be mis-handled.
    The limits imposed on large lists by SharePoint, are largely attributable DIRECTLY BACK TO SQL (specifically, the number of records that can be obtained with ROW locks before switching to PAGE locks or TABLE locks, which have LARGER impacts).
    So again, BCS is an option, but whether it's the "right solution for us" is more dependent. Plus, you would probably also benefit by spending some time investigating the other uses (web parts/etc) for opportunities to improve their performance,
    user experience, etc.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Difference between Infotype and Database table

    Hi all,
    in SAP ABAP-HR we have the concept of INFOTYPE. will anybpdy please tell me , in simple word, what exactly is it? and what are the difference of INFOTYPE with DATABASE TABLE.
    Anirban Bhattacharjee

    hi,
        infotypes contains group of logically related fields on a single screen (just like TABLE) and which is bounded by TIME CONSTRIANT (no time constrint for table).
    main diffarence is TIME CONSTRAINT, means validity period of data records in infotypes based on time constrint only.
    for more information on time constrint follow this link.........
    http://help.sap.com/saphelp_erp2005/helpdata/en/48/35c9f24abf11d18a0f0000e816ae6e/content.htm
    each infotype contains, its corresponding database table.
    ex: 0002---> personal information.
         its database table: pa0002.
        the table pa0002 contains four strctures pakey, pshd1, ps0002 and ci_p0002.
        pakey-->contains key fields information.
        psdh1--->contains last logon detils (usename....)
        ps0002--->contains infotype specific fields.
        ci_p0002--> for furthur addinf an any extra fields
    Edited by: Ashok Reddy on Jun 25, 2008 2:12 PM

  • Create a data source and database tables using WSAD

    Hi, guys:
    the following is from a tutorial:
    http://www-106.ibm.com/developerworks/websphere/techjournal/0306_wosnick/wosnick.html
    "To create the data source and Cloudscape database tables automatically, right click on the HelloWorldServer in the Servers view, and select the Create tables and data sources menu item. A dialog will then display showing that the data source and database tables were created successfully (Figure 5)."
    I am using WSAD 5.0 trial version. I cannot find Create tables and data sources menu item if I right click on the HelloWorldServer in the Servers view. I am wondering if this is because trial version does not have this feature?
    regards

    This question is a little off topic but you may get a reply. Please note this forum is about Sun's J2EE SDK and its related technologies. You may have better luck posting your question to an IBM specific resource.

  • EAI is just about  WS and database interaction or WS and What

    Salut,
    I want a straightforward answer for this question
    EAI: is it about WS and legacy database interaction or what ?

    Hello,
    Have you take a look to BPEL (Business Process Execution Language) that is a language that use Web Services to define your business process.
    Take a look to the BPEL page on OTN and you will learn about what can WS give you in term of EAI. For example Oracle Application server with its adaptor based on JCA allow you to publish this JCA information as Web Service so you can leverage any legacy system...
    - BPEL Page
    Regards
    Tugdual Grall

  • Joins query between itab and database table..

    Hi all,
    Is it posible to use joins query between internle table and data base table...

    Hi Mehboob,
    No thats impossible to join the internal table and the database table.
    Alternatively what you need to do is you need to execute a Queryin Database Table and use the For All Entries in itab.
    Eg:  Select * from marc into table it_marc
             for all entries in it_matnr
               where matnr = it_matnr-matnr.
    Thanks,
    Chidanand

  • Update database table from a work area

    hi!
    I have a workarea that is like the corresponding database table. There are a lot of fields so I dont want to update each field with an UPDATE but instead I want to do som sort of:
    UPDATE dbase_table
    FROM work_area
    WHERE dbase_table-primary_key = work_area-primary_key
    I could only find a statement called UPDATE dbase_table FROM  work_area but I dont understand how without specifying a WHERE clause it knows which rows to update.
    regards
    Baran

    UPDATE  dbtab      FROM wa. or
    UPDATE (dbtabname) FROM wa.
    Extras:
    1. ... CLIENT SPECIFIED
    2. ... CONNECTION con
    Effect
    Changes one single line in a database table, using a primary key to identify the line and taking the values to be changed from the specified work area, wa. The data is read out of wa from left to right, matching the line structure of the database table dbtab. The structure of wa remains unchanged. This means that wa must be at least as wide (see DATA) as the line structure of dbtab, and have the same alignment. Otherwise, a runtime error occurs.
    If either the database table, dbtab, or the work area, wa, contain Strings, wa must be compatible with the line structure of dbtab.
    Example
    Changing the telephone number of the customer with customer number '12400177' in the current client:
    DATA   wa TYPE scustom.
    SELECT SINGLE * FROM scustom INTO wa
      WHERE id = '12400177'.
    wa-telephone = '06201/44889'.
    UPDATE scustom FROM wa.
    When the command has been executed, the system field SY-DBCNT contains the number of updated lines (0 or 1).
    Examples
    Update discount for the customer with the customer number '00017777' to 3 percent (in the current client):
    DATA: wa TYPE scustom.
    SELECT SINGLE * FROM scustom INTO wa
      WHERE id = '00017777'.
    wa-discount = '003'.
    UPDATE scustom FROM wa.
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The specified line has been updated.
    SY-SUBRC = 4:
    The system could not update any line in the table, since there is no line with the specified primary key.
    BR< JAcek

  • Temporary data carriers for Database tables

    hi Gurus,
    How can we find temporary Data Carriers for database tables. For eg.   when we craete a BOM in CS01/CS02 the data first goes to RC29P structure and when system finishes it goes to STPO.
    This is one example. how canw e find other structures and theirs corresponding Database Tables?
    Any idea?
    Regards

    Hi Greg,
    Those are the aggregated tables. If they are not filled with data although the Portal Activity Report is activated, you should check whether the aggregation finished successfully.
    In the older SPs there were some problems that were fixed in later SPs of 7.0.
    In order to have the latest version of Portal Activity report, you can check SAP note 1084379 - Portal Activity Report - Latest Version (SDA file).
    You can compare the SP via the MANIFAST file, as it contains the version and SP number.
    In order to troubleshoot problems in Activity Report, you can follow SAP note: 1690023 - Portal Activity Report - Component-specific Note
    Some basic checks that you can do:
    Run query on the raw data tables to check since when there is data in those tables:
    select min(timestamphour) from SAP<SystemID>DB.WCR_WEBCNODESTAT;
    If there is too much data from long time ago, then you should delete the old data, and leave only the new data (there is anyways retention time for the data to be kept).
    If there is no data, then it means that the Portal Activity Report does not collect data, and not really activated (usually this is not the case).
    The aggregation runs every top of the hour, so you can check in the default traces for an error during that time.
    In most of the cases something went wrong while aggregating the data.
    As a result the aggregation is not finished, so the transaction is not being committed, and the aggregated tables stay empty.
    If there is a DuplicateKeyException in the trace, you can follow SAP note 1054145 - Duplicate Key Exception.
    If you have any more questions, please don't hesitate to ask.
    I hope this information helps,
    Thanks & regards,
    Michal Zilcha-Lang

  • Regardig error while updating the database table

    hi experts,
       i m trying to update the database table from the values containig in my internal table  ,,,but the system is giving this error plz help me::::
    The type of the database table and work area (or internal table)
    "ITAB_UPDATE" are not Unicode convertible. Unicode convertible.          
    my internal table name itab_update and the database table name yitab.i m using this statement::
        modify yitab from itab_update.

    Hi
    1. You  have to Declare the Itab with the same structure as DB table.
    2. Use the statement
        Modify <DBtable> from TABLE <itab>.
    or
       Update <DBtable> from TABLE <itab>.
    Hope this will solve.
    Reward .....if so.
    Regards.

  • How to pass values in dynamic structure and then dynamic table

    Hi,
    we have a Z structure in se11 holding 10 fields. But at run time i need to create a dynamic table with more than 10 records.
    I am able to create the structure and corresponding internal table. Now the issue is i have to populate this dynamic structure with some values and then append it to dynamic internal table. Since the dynamic  table type is any its not allowing an index operation like modify etc etc.
    Could anyone help me in passing the values . I have searched in SDN . everyone created a dynamic table and then populated it values from some standard or custom tables.Then assigning the component of structure  and displaying the output. but in my situation i have no such values stored in any tables. i populate values based on certain calculation.

    Hi Friends,
    This is the piece of code.After creating dynamic work area and dynamic table what i should do?
    TYPES: BEGIN OF STR,
    ID TYPE I,
    NAME(30) TYPE C,
    END OF STR.
    data: v_lines type i.
    STR_TYPE ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( 'STR' ).
    STR_COMP = STR_TYPE->GET_COMPONENTS( ).
    APPEND LINES OF STR_COMP TO COMP_TAB.
    COMP-NAME = 'NAME1'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING(  ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'VALUE1'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'NAME2'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'VALUE2'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'NAME3'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    COMP-NAME = 'VALUE3'.
    COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
    APPEND COMP TO COMP_TAB.
    NEW_STR = CL_ABAP_STRUCTDESCR=>CREATE( COMP_TAB ).
    NEW_TAB = CL_ABAP_TABLEDESCR=>CREATE(
    P_LINE_TYPE = NEW_STR
    P_TABLE_KIND = CL_ABAP_TABLEDESCR=>TABLEKIND_STD
    P_UNIQUE = ABAP_FALSE ).
    CREATE DATA DREF TYPE HANDLE NEW_TAB.
    CREATE DATA DREF1 TYPE HANDLE NEW_str.

Maybe you are looking for