Insert Lookup record

Hi All,
   My problem is with MDM and Java APIs below is my requirement
I have a,
          Main table name     : Products
          Lookup table name  : Details
Lookup table has one qualifier and one non qualifier field.
I have to insert a record into the Products table, iam able to enter the values for the normal fields like text, integer etc. But not able to enter the lookup record. Can you please let me know how this can be achieved, also if u have any sample code for this it would be of great help.

Hi Mausam,
Thanks for the reply, I tried following those steps please see the code below, it is  still not working..
I have added a record into the main table and the record id is stored in the variable <b>"id"</b>
Now iam doing the following steps
//"Products" is the main table
//"details" is the lookup table entry in the main table
<b>//Create a Qualified Link between main table and qualified table</b>
QualifiedLinkArray qualifiedLinkArray = new QualifiedLinkArray();
QualifiedLink qualifiedLink = new QualifiedLink();
<b>// specify the values of "YES" qualifiers</b> Value val = new Value("Dev");
A2iField sd = new A2iField("Name", val); 
qualifiedLink.GetQualifiers().Add(sd);
qualifiedLinkArray.Add(qualifiedLink);
int changeStamp = rs.GetChangeStampAt(id);
catalog.AddQualifiedLinks("Products", "details", id,qualifiedLinkArray, changeStamp);
<b>But Iam not inserting the values of "NO" qualifiers anywhere.. have i missed out any steps??</b>
Please help..
Regards
Suresh

Similar Messages

  • Insert a record in Qualified Lookup Table

    Hello everyone,
    I need code to insert a record in Qualified Lookup Table where the non-qualifier is a record of type Country. Other fields are qualifiers.
    I tried using QualifiedLookupValue.createQualifiedLink(). However, this only helps to insert in the qualifier values, how can I insert the non-qualifier (Country) value?
    Any idea?
    Many thanks in advance,
    Baez

    Hi guys,
    Maybe the answer comes late but i'm recently working on this and the API works for me to create and update qualifier values.
    Suppose recordMain is the main record, fldQFT is the qualified lookup field in main table, fldQualifier is the qualifier field in QFT table.
    To add qualifier value you can use:
    QualifiedLookupValue qualifiedLookupValue = new QualifiedLookupValue();
    int index = qualifiedLookupValue.createQualifiedLink(recordMain.getId());
    qualifiedLookupValue.setQualifierFieldValue(index, fldQualifier, MdmValue);
    recordMain.setFieldValue(fldQFT, qualifiedLookupValue);
    To update qualifier value, use:
    QualifiedLookupValue qualifiedLookupValue = (QualifiedLookupValue) recordMain.getFieldValue(fldQFT);
    qualifiedLookupValue.setQualifierFieldValue(index, fldQualifier, MdmValue);
    recordMain.setFieldValue(fldQFT, qualifiedLookupValue);
    Regards,
    James

  • Error inserting XML records 4000 bytes through Pro*C

    Hi,
    I am seeing the following error while trying to insert XML records > 4000 bytes (Records < 4000 bytes get inserted without any issues). Any help in resolving the issue would be highly appreciated.
    ORA return text: ORA-01461: can bind a LONG value only for insert into a LONG column.
    I am also able to insert records > 4000 bytes using the following query, But, I want to insert the records through a C application (using Pro*C) that is not running on the database server.
    INSERT INTO MY_XML_TABLE
    VALUES (XMLType(bfilename('XML_DIR', 'MY_FILE.XML'),
    nls_charset_id('AL32UTF8')));
    Oracle Version
    ===============
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for Solaris: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    Pro*C/C++ version:
    ====================
    Pro*C/C++ RELEASE 11.2.0.0.0 - PRODUCTION
    Schema registration:
    ====================
    begin
    DBMS_XMLSCHEMA.registerSchema (
    SCHEMAURL => 'MY_XML_SCHEMA.xsd',
    SCHEMADOC => bfilename ('ENG_REPORTS', 'MY_XML_SCHEMA.xsd'),
    GENTYPES => FALSE,
    OPTIONS => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
    CSID =>nls_charset_id ('AL32UTF8'));
    end;
    Table creation
    ===============
    CREATE TABLE MY_XML_TABLE (
    MY_XML_RECORD XmlType )
    XMLTYPE MY_XML_RECORD STORE AS BINARY XML
    XMLSCHEMA "MY_XML_SCHEMA.xsd" ELEMENT "MYXMLTAG" ;
    Record Insertion (Pro*C generated code):
    =========================================
    /* EXEC SQL FOR :l_sizeof_array_togo
    insert INTO MY_XML_TABLE
    (MY_XML_RECORD )
    VALUES( XMLTYPE(:l_XML_ptr INDICATOR :l_XML_indicators )); */
    struct sqlexd sqlstm;
    sqlstm.sqlvsn = 12;
    sqlstm.arrsiz = 1;
    sqlstm.sqladtp = &sqladt;
    sqlstm.sqltdsp = &sqltds;
    sqlstm.stmt = "insert into MY_XML_TABLE (MY_XML_RECORD) values (XMLTYPE(:s1\
    :s2 ))";
    sqlstm.iters = (unsigned int )l_sizeof_array_togo;
    sqlstm.offset = (unsigned int )20;
    sqlstm.cud = sqlcud0;
    sqlstm.sqlest = (unsigned char *)&sqlca;
    sqlstm.sqlety = (unsigned short)4352;
    sqlstm.occurs = (unsigned int )0;
    sqlstm.sqhstv[0] = (unsigned char *)&l_XML_ptr->xml_record;
    sqlstm.sqhstl[0] = (unsigned long )8002;
    sqlstm.sqhsts[0] = ( int )sizeof(struct xml_rec_definition);
    sqlstm.sqindv[0] = ( short *)&l_XML_indicators->XML_record_ind;
    sqlstm.sqinds[0] = ( int )sizeof(struct XML_indicator);
    sqlstm.sqharm[0] = (unsigned long )0;
    sqlstm.sqadto[0] = (unsigned short )0;
    sqlstm.sqtdso[0] = (unsigned short )0;
    sqlstm.sqphsv = sqlstm.sqhstv;
    sqlstm.sqphsl = sqlstm.sqhstl;
    sqlstm.sqphss = sqlstm.sqhsts;
    sqlstm.sqpind = sqlstm.sqindv;
    sqlstm.sqpins = sqlstm.sqinds;
    sqlstm.sqparm = sqlstm.sqharm;
    sqlstm.sqparc = sqlstm.sqharc;
    sqlstm.sqpadto = sqlstm.sqadto;
    sqlstm.sqptdso = sqlstm.sqtdso;
    sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);
    }

    After selecting data from xmltab table I just received first line of xmldata file. i.e
    <?xml version="1.0" encoding="WINDOWS-12 52"?> <BAROutboundXM L xmlns="http://BARO
    That must be a display issue.
    What client tool are you using, and what version?
    If SQL*Plus, you won't see the whole content unless you set some options :
    {code}
    SET LONG <value>
    SET LONGCHUNKSIZE <value>
    {code}
    Could you try the following?
    {code}
    SET LONG 10000
    SELECT t.object_value.getclobval() FROM xmltab t;
    -- to force pretty-printing :
    SELECT extract(t.object_value, '/*').getclobval() FROM xmltab t;
    {code}
    Edited by: odie_63 on 16 févr. 2011 08:58

  • Can you use ESB to insert multiple records into a Database

    We have an XML file that has a Parent/Child relationship.
    In situation 1 we have a single parent record in the xml file. We can insert the record into the database successfully.
    In situation 2 we have a parent and a an associated child record. By using a filter expression to identify the existence of the child record we can route to the first DB Adapter to insert the parent then to the second DB Adapter to insert the child.
    Is this final scenario logical and also possible.
    Situation 3 we have multiple child records associated to a single parent. So we would first insert the parent record then insert all the child records.
    Thanks

    I use PL/SQL for this if you are using Oracle.
    Have a look at this post, it is for AQ but the concept can be used for PL/SQL
    Re: Can I pass a pl/sql table as a parameter from a database adaptor
    I will send you an example
    cheers
    James

  • Inserting multiple records into a database from a table

    I have a dynamic table with rows upto 10. i am trying to insert all the records in these rows into a database ( msaccess)
    table name: Table1 ( in my form )
    Database table : movies_comments ( as posted in stefan's forums ).
    table columns: username, movieid, comments
    i am using the following code.
    Database.ExecSQL() function is as posted in stefcamerons forums.
    var tlength = xfa.resolveNode("form1.#subform[0].Table1.Row1[*]").length;
    xfa.host.messageBox("tlength is :" +tlength);
    for ( var i = 1; i <= tlength; i++)
    var username = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].user_name").rawValue;
    var movieID = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].movie_id").rawValue;
    var commentS = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].comment_").rawValue;
    Database.ExecSQL("INSERT INTO movie_comments (username, movieId, comment) VALUES ('username','movieID', 'commentS');");
    i am trying to insert multiple records using the code above. But i am getting error
    GeneralError: Operation failed.
    XFAObject.resolveNode:1:XFA:form1[0]:#subform[0]:Button1[0]:click
    SOM expression returned list when single result was expected
    suggest me an alternate way to insert multiple records from a table into a database.
    thank Q

    figured it out. I changed the ...OR (alternative names = colname) in the recordset to ...OR (alternative names LIKE %colname%). Works like a charm now- the result of a good night's sleep.

  • Insert multiple records into a table(Oracle 9i) from a single PHP statement

    How can I insert multiple records into a table(Oracle 9i) from a single PHP statement?
    From what all I've found, the statement below would work if I were using MySQL:
         insert into scen
         (indx,share,expire,pitch,curve,surface,call)
         values
         (81202, 28, 171, .27, 0, 0, 'C' ),
         (81204, 28, 501, .25, 0, 0, 'C' ),
         (81203, 17, 35, .222, 0, 0, 'C' ),
         (81202, 28, 171, .27, 2, 0, 'C' ),
         (81204, 28, 501, .20, 0, 1, 'C' ),
         (81203, 28, 135, .22, 1, 0, 'C' )
    The amount of records varies into the multiple-dozens. My aim is to utilize the power of Oracle while avoiding the i/o of dozens of single-record inserts.
    Thank you,
    Will

    You could look at the INSERT ALL statement found in the documentation here:
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_913a.htm#2133161
    My personal opinion is that you probably won't see any benefit because under the hood I think Oracle will still be doing single row inserts. I could be wrong though.
    The only way to confirm was if you did a test of multiple inserts vs an INSERT ALL, that is if the INSERT ALL met your requirements.
    HTH.

  • How to insert multile records at a time in same db table

    Hi All,
    I want to insert more than one record in db-tabe.As ADF-Form /ADF-Creation form will insert only one record at time is there any way to insert multiple records using ADF-Table
    Thanks in Advance
    Regards
    RHY

    See the following section in the ADF Developer's Guide for Forms/4GL Developers for some insights on this:
    (*) 10.4.3 When to Use CreateInsert Instead of Create
    You can find the guide on the ADF Learning Center here:
    http://www.oracle.com/technology/products/adf/learnadf.html

  • Error in inserting a record in to table

    hi..
    i created a trigger....when i am trying to insert new record in to table i am getting the fallowing error...plz kindly help me out from this...
    SQL> create or replace trigger secure_emp
    2 before insert on employees begin
    3 if(to_char('sysdate','DY') in ('SAT','SUN')) or
    4 (to_char('sysdate','HH24:MI') not between '8:00' and '18:00') then
    5 raise_application_error(-20500,'error');
    6 end if;
    7 end;
    8 /
    Trigger created.
    SQL> insert into employees(employee_id,last_name,first_name,email,hire_date,job_id,salary,department
    _id)
    2 values (300,'smith','jack','SJACK',sysdate,'IT_PROG',4500,60);
    insert into employees(employee_id,last_name,first_name,email,hire_date,job_id,salary,department_id)
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at "SCOTT.SECURE_EMP", line 2
    ORA-04088: error during execution of trigger 'SCOTT.SECURE_EMP'

    Yeah. Whenever Oracle sees TO_CHAR('string_literal1', 'string_literal2), it implicitly converts it to TO_CHAR(TO_NUMBER('string_literal1'), 'string_literal2). That's why an error in trigger occurs.
    SQL> explain plan for
      2  select null
      3    from dual
      4   where dummy = to_char('A', 'DY');
    Explained
    SQL> @utlxpls
    Cannot SET MARKUP
    PLAN_TABLE_OUTPUT
    Plan hash value: 397561404
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |     2 |     2   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| DUAL |     1 |     2 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("DUMMY"=TO_CHAR(TO_NUMBER('A'),'DY'))
    13 rows selected

  • Error when inserting a Record Form

    Hi,
    I'm very green with web development and am just trying my hand at PHP. I've set up a database with Mysql and phpmyadmin  those are working fine.
    I had inserted a record form using the record insertion form wizard and it worked just fine. I deleted it because I wanted some different information and
    now every time I try to insert a new form this error message comes up.
    While executing onClick in ServerObject-InsRecPHP.htm, the following JavaScript error(s) occurred:
    At line 5694 of file 'C:\Program Files (x86)Adobe\Adobe Dreamweaver CS5\Configuration\Shared\Common\Scripts\dwscriptsExtData.js':this.node has no
    properties.
    I've gone to look at the file but I'm not sure how to tell if the properties are working or not. I've also googled this problem but haven't found someone with exactly my dilemma. Any help will be greatly appreciated!
    Thank you for your time

    Troubleshooting JavaScript errors in Dreamweaver
    http://kb2.adobe.com/cps/405/kb405604.html
    Try #4 and #12 first.

  • Problem while inserting a record to infotype 416

    Iam facing a problem while inserting a record to the infotype 416 for a personnel no using the FM 'HR_INFOTYPE_OPERATION'.I have created a FM to insert a record to the infotype 416.In that FM iam using the FM 'HR_INFOTYPE_OPERATION' to create a record for infotype 416.while executing  my FM the FM 'HR_INFOTYPE_OPERATION' is returning the return value 0.But when i check in PA30 for the infotype 416,there is no record created for that personnel no.Also in the table PA0416 the record is not get created.SO what might be the problem.can anyone please provide me help on this.
    I have attached the code of my FM for ur reference.
    FUNCTION Y_ESS_FL_ENCASH.
    DATA: G_COMPENSATION_AMOUNT LIKE PA0416-AMONT,
          G_RETURN TYPE BAPIRETURN1.
    DATA T_PA0416 LIKE P0416 OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'HR_READ_INFOTYPE'
        EXPORTING
           TCLAS                 = 'A'
           PERNR                 = '00000014'
           INFTY                 = '0416'
         BEGDA                 = sy-datum
         ENDDA                 =  sy-datum
           BYPASS_BUFFER         = 'X'
         LEGACY_MODE           = ' '
    IMPORTING
         SUBRC                 =
          TABLES
            INFTY_TAB             = T_PA0416
    EXCEPTIONS
      INFTY_NOT_FOUND       = 1
      OTHERS                = 2
        LOOP AT T_PA0416
        WHERE SUBTY = '1002'.
        ENDLOOP.
        IF SY-SUBRC <> 0.
          CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
            EXPORTING
               NUMBER = '00000014'
            IMPORTING
               RETURN = G_RETURN.
          IF SY-SUBRC <> 0.
             MESSAGE I016(RP) WITH ' RECORD IS ALREADY LOCKED'.
          ENDIF.
          T_PA0416-PERNR = '00000014'.
          T_PA0416-SUBTY = '1002'.
          T_PA0416-INFTY = '0416'.
          T_PA0416-OBJPS = ''.
          T_PA0416-SPRPS = ''.
          T_PA0416-SEQNR = ''.
          T_PA0416-AEDTM = SY-DATUM.
          T_PA0416-UNAME = SY-UNAME.
          T_PA0416-ENDDA = SY-DATUM.
          T_PA0416-BEGDA = SY-DATUM.
          T_PA0416-NUMBR = '10'.
          T_PA0416-WGTYP = '1530'.
          T_PA0416-AMONT = '15000'.
          T_PA0416-WAERS = 'INR'.
          T_PA0416-QUONR = '1'.
          APPEND T_PA0416.
          CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              INFTY                  = '0416'
              NUMBER                 = '00000014'
              SUBTYPE                = '1002'
      OBJECTID               =
      LOCKINDICATOR          =
             VALIDITYEND            = '31129999'
             VALIDITYBEGIN          = SY-DATUM
            RECORDNUMBER           = ''
              RECORD                 = T_PA0416
              OPERATION              = 'INS'
              TCLAS                  = 'A'
      DIALOG_MODE            = '0'
            NOCOMMIT               = 'X'
      VIEW_IDENTIFIER        =
      SECONDARY_RECORD       =
            IMPORTING
              RETURN                 = G_RETURN.
      KEY                    =
          IF G_RETURN+0(1) EQ 'E'.
                  MESSAGE I086(ZHR) WITH 'Record is not inserted in IT416'.
          ELSE.
              COMMIT WORK.
          ENDIF.
          CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
            EXPORTING
              NUMBER = '00000014'
            IMPORTING
              RETURN = G_RETURN.
        ENDIF.
    ENDFUNCTION.

    Hi Murthy
    With a first glance, I think you have given a wrong parameter value to "validityend". It should be '99991231' not '31129999' .
    If your problem still persists, try inserting the data online from PA30. If your input causes no errors, then please state what the return parameter contains.
    Regards
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • Receiver JDBC: Error while doing the Deleting and Inserting new records

    Hi All,
              I am doing Idoc to JDBC scenario. In this I am collecting & bundling different type of Idocs and then sending to the JDBC receiver. My requirement is to delete the existing records in the database and insert the new records. I have configures as mentioned in the link
    Re: Combining DELETE and INSERT statements in JDBC receiver
    In the above link its shows for single mapping. In my scenario I am using multi mapping for collecting idocs in BPM. If I configured for normal mapping then it is working fine(Deleting existing records and Inserting new record). Whenever I am using multi mapping then I am getting following error in the receiver JDBC communication channel u201CError while parsing or executing XML-SQL document: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)u201D . Can you please tell me what might be the problem.
    Thanks & Regards,
    T.Purushotham

    Hi !
    check this out:
    JDBC - No 'action' attribute found in XML document - error
    JDBC receiver adapter: No 'action' attribute found in XML document
    It appears that the inbound payload (the one that is going from XI to the JDBC adapter) does not have the requiered tag to specify which SQL action to execute in the receiver system. Maybe the multimapping is not creating the desired output message format.
    Regards,
    Matias.

  • Problem with inserting new records in Oracle Forms

    Hi Friends,
    I am a new user to Oracle Forms and I need a help from you people. The problem is as follows:
    I have a data block in which I can display a number of records. In this data block the user will be able to edit the fields if no child records are found in another table. I have used when-new-record-instance to attain this scenario. All are text items. One item licensee_id which is made invisible by setting the property in property palette and required=no ( as this is the primary key of the table). Also the audit columns are made invisible.
    The code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
         v_cnt                          NUMBER;
    BEGIN
         SELECT COUNT (*)
    INTO v_cnt
    FROM id_rev_contracts
    WHERE licensee_id = :ID_REV_LICENSEES.licensee_id;
    IF v_cnt > 0 THEN
    set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_FALSE);
    ELSE
         set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_TRUE);
         -- set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', INSERT_ALLOWED, PROPERTY_TRUE);
    END IF;
    END;
    Now in this data block I should also be able to insert new records and for the same I have used PRE-INSERT trigger and the code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
    CURSOR v_licensee_id IS SELECT id_rev_licensees_s.NEXTVAL FROM dual;
    BEGIN
    OPEN v_licensee_id;
    FETCH v_licensee_id INTO :id_rev_licensees.licensee_id;
    CLOSE v_licensee_id;
    IF :id_rev_licensees.licensee_id IS NULL THEN
    Message('Error Generating Next v_licensee_id');
    RAISE Form_Trigger_Failure;
    END IF;
    :ID_REV_LICENSEES.created_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.last_updated_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.create_date := SYSDATE;
    :ID_REV_LICENSEES.last_update_date := SYSDATE;
    EXCEPTION
    WHEN form_trigger_failure
    THEN
    RAISE form_trigger_failure;
    WHEN OTHERS
    THEN
    v_alert_button :=
    msgbox ('ERROR in Pre-Insert - ' || SQLERRM, 'STOP', 'Contact IST');
    RAISE form_trigger_failure;
    END;
    Every thing is compiling fine but at the run time when I am trying to insert a new record I am receiving the following error:
    FRM-40508:ORACLE error:unable to insert record
    I also think the pre-insert record is not firing at the time of inserting a new record and saving it. So I request you to please delve into this problem and suggest me how to overcome this problem. Code snippets would do more help for me. If you need any other things from me please let me know. I will see if I could be of any help in that concern because I may not be able to send the entire form as it is.
    Thanks and regards,
    Vamsi K Gummadi.

    first of all
    pre-insert fires after the implicit/explicit commit/commit_form is issued and before the real insert is submitted to the db.
    i would suggest to remove the error handling part for the moment
    because i believe you might be getting "ora-xxxx cannot insert null"
    and also make visible the primary column to check if the pre-insert is executed.
    it would be better to make visible for a while the not null columns of the table/block
    i suppose that the block is insert allowed and you are using table as the source of the block and not any procedures or something...

  • [php+mysql] how to insert 3 records at once and print out all 3 records?

    Hi all,
    I have to create a serie of pages that allow the user to:
    1- Insert 3 records in a mysql db at once
    2- click NEXT
    3- viewverify//print the data that he has entered (all 3
    records)
    4- click PRINT
    5- click FINISH
    then, restart from 1
    What is the best way to do this?
    TIA for any suggestion.
    tony

    The best way is usually to use a stored procedure. Do you
    know if the version of MySQL you are using supports sprocs?

  • Insert missing records dynamically in SQL Server 2008 R2

    Hi, I am working on a requirement where I will have to work on some % calculations for 2 different states where we do business. The task that I am trying to accomplish is technically we need to have any Product sales in both the states if not for instance
    in the following example ProductC does not have sales in OR so I need to insert a record for ProductC - OR with 0. This is an intermediary resultset of all the calculations that I am working with.
    Example Dataset:
    CREATE TABLE [dbo].[Product](
    [Product] [varchar](18) NOT NULL,
    [State] [varchar](5) NOT NULL,
    [Area1] [int] NOT NULL,
    [Area2] [int] NOT NULL,
    [Area3] [int] NOT NULL,
    [Area4] [int] NOT NULL,
    [Area5] [int] NOT NULL,
    [Area6] [int] NOT NULL,
    [Area7] [int] NOT NULL,
    [Area8] [int] NOT NULL,
    [Area9] [int] NOT NULL,
    [Area10] [int] NOT NULL,
    [Total] [int] NULL
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductA','OR',0,0,2,0,2,0,0,0,0,0,4)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductA','WA',0,0,1,0,0,0,0,0,0,0,1)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductA','Total',0,0,3,0,2,0,0,0,0,0,5)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductB','OR',0,0,5,0,0,0,0,0,0,0,5)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductB','WA',0,0,2,0,0,1,0,0,0,0,3)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductB','Total',0,0,7,0,0,1,0,0,0,0,8)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductC','WA',0,0,0,0,0,0,0,0,0,1,1)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductC','Total',0,0,0,0,0,0,0,0,0,1,1)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductD','OR',5,2,451,154,43,1,0,0,0,0,656)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductD','WA',0,20,102,182,58,36,0,1,0,0,399)
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductD','Total',5,22,553,336,101,37,0,1,0,0,1055)
    How to accomplish this in SQL Server 2008 R2.
    Insert missing record:
    INSERT INTO [Product] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductC','OR',0,0,0,0,0,0,0,0,0,0,0)
    Thanks in advance......
    Ione

    CREATE TABLE [dbo].[Products](
    [Product] [varchar](18) NOT NULL,
    [State] [varchar](5) NOT NULL,
    [Area1] [int] NOT NULL,
    [Area2] [int] NOT NULL,
    [Area3] [int] NOT NULL,
    [Area4] [int] NOT NULL,
    [Area5] [int] NOT NULL,
    [Area6] [int] NOT NULL,
    [Area7] [int] NOT NULL,
    [Area8] [int] NOT NULL,
    [Area9] [int] NOT NULL,
    [Area10] [int] NOT NULL,
    [Total] [int] NULL
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductA','OR',0,0,2,0,2,0,0,0,0,0,4)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductA','WA',0,0,1,0,0,0,0,0,0,0,1)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductA','Total',0,0,3,0,2,0,0,0,0,0,5)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductB','OR',0,0,5,0,0,0,0,0,0,0,5)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductB','WA',0,0,2,0,0,1,0,0,0,0,3)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductB','Total',0,0,7,0,0,1,0,0,0,0,8)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductC','WA',0,0,0,0,0,0,0,0,0,1,1)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductC','Total',0,0,0,0,0,0,0,0,0,1,1)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductD','OR',5,2,451,154,43,1,0,0,0,0,656)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductD','WA',0,20,102,182,58,36,0,1,0,0,399)
    INSERT INTO [Products] ([Product],[State],[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])VALUES('ProductD','Total',5,22,553,336,101,37,0,1,0,0,1055)
    ;WIth mycte as (
    Select Product,State From (Select distinct Product from Products) p, (
    Select distinct State from Products) s
    Insert into [Products](Product,State,[Area1],[Area2],[Area3],[Area4],[Area5],[Area6],[Area7],[Area8],[Area9],[Area10],[Total])
    Select m.Product,m.State
    ,0,0,0,0,0,0,0,0,0,0,0
    from mycte m Left Join Products p on m.[Product]=p.Product and m.State=p.State
    WHERE p.Product is null and p.State is null
    select * from Products
    Order by Product
    ,Case when State='Total' Then 2 else 1 End
    Drop table Products

  • Inserting a record in backend using syncbo

    Hi,
    I have a header table and item table like,
    EmpHdr-- fields 1) empno
                            2)ename
    EmpItem--fields 1) empno
                            2)designation
    how can I insert a record in the tables using syncbo.Can any body provide me the detail code.I am new to MI.Please help me.
    MerepMeta.xml
    <?xml version="1.0" encoding="utf-8"?><MeRepApplication schemaVersion="1.1" id="ZNEWEMPMCD" version="1.0"><Property name="CLIENT.BUILDNUMBER"></Property><Property name="C_APPLRESOLVE"></Property><Property name="DATA_VISIBLE_SHARED">X</Property><Property name="E_APPLRESOLVE"></Property><Property name="HOMEPAGE.INVISIBLE"></Property><Property name="INITVALUE"></Property><Property name="RUNTIME">JSP</Property><Property name="TYPE">APPLICATION</Property>
    <SyncBO id="ZNEWEMP" version="3" type="twoWay" allowCreate="true" allowModify="true" allowDelete="true" reqDirectSync="true" downloadOrder="1">
    <TopStructure name="TOP">
    <Field name="SYNC_KEY" type="N" length="10" decimalLength="0" signed="false" isKey="true" isIndex="true"><Input type="create">false</Input><Input type="modify">false</Input></Field>
    <Field name="ZEMPID" type="C" length="10" decimalLength="0" signed="false" isKey="false" isIndex="false"/>
    <Field name="ZEMPNAME" type="C" length="20" decimalLength="0" signed="false" isKey="false" isIndex="false"/>
    <ChildStructure name="010">
    <Field name="SYNC_KEY" type="N" length="10" decimalLength="0" signed="false" isKey="true" isIndex="true"><Input type="create">false</Input><Input type="modify">false</Input></Field>
    <Field name="ZEMPID" type="C" length="10" decimalLength="0" signed="false" isKey="false" isIndex="false"/>
    <Field name="ZDESIG" type="C" length="15" decimalLength="0" signed="false" isKey="false" isIndex="false"/>
    </ChildStructure>
    </TopStructure></SyncBO></MeRepApplication>
    Regards,
    Srikanth Reddy.T
    Edited by: Srikanth Thatipally on Oct 21, 2008 8:22 AM

    Hello,
    Please refer to the API:
    https://admin.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/library/mobile/mobile-infrastructure/mobile%20development%20kit%202.5/content/javadoc/overview-summary.html
    Look into the smartcyn package. You will want to create an instance f your sync bo and add rows into it. The API is pretty straightforward.
    You can also use mCAF that is shipped with MAM/MAU/DSD/etc that hides the technicalities from you.
    Thank you,
    Julien.
    http://www.msc-mobile.com

Maybe you are looking for

  • Issues ordering with 2 phone lines on one account.

    After being on the phone for half an hour on Friday the woman seemed to understand everything but we got no confirmation message so I called again today and after spending an hour on the phone was told to call back tommorow.. Not getting my hopes up

  • Sharing problems on my g5

    Hi, I posted a question a few days ago and have gotten no replies (aaack!) so maybe I need to change it a little. I am having problems with my G4 connecting to my G5 (my G% can connect to my G4 but not the other way around). Anyway, I think it has so

  • Alltel 8130 and Nissan Bluetooth Car Kit

    HELP!!! New Nissan Altima with Bluetooth Car Kit.  I am able to pair no problem, make and receive call without a hitch.  Downloaded phone book with ease.  The problem is whenever I use the phone with the car kit after I exit the car the phone locks u

  • EP 6.0 SP2 to NW Portal SR1 migration

    I am doing EP 6.0 SP2 to NW EP SR1 migration following How To .. Guide Version 9.00- july 2005. Page 40, 4.1.1 item 3. Location the KM software components on the NW'04 SR1 installation DVD, in the folders at ...\EP-KMC\. choose and redeploy all the s

  • How to make graphics move fluidly around screen?

    hi, I'm making a simple space invaders game using JPanel and have so far made the ship and aliens move around the screen (the aliens move automatically, the ship requires key presses). The ship and aliens are currently simple java 2D shapes and I've