Problem with inserting a record

Hi Friends,
I want to update my database table with new record for this I wrote a coding like this, but i am unable to update the database table please find my coding:
LOOP AT lt_invmov INTO lw_invmov WHERE check = 'X'.
          SELECT  MAX( trans )
                     INTO zinv_mov-trans FROM zinv_mov.
          IF sy-subrc EQ 0.
            zinv_mov-trans = zinv_mov-trans + '0000000001'.
          ELSE.
            MOVE '0000000001' TO zinv_mov-trans.
          ENDIF.
          itab-lifnr     =   lw_invmov-lifnr.
          itab-xblnr     =   lw_invmov-xblnr.
          itab-bukrs     =   lw_invmov-bukrs.
          itab-usnam     = zinv_mov-usnam.
          itab-appdate   = sy-datum.
          MOVE 'V2' TO itab-status.
          MOVE 'CL' TO itab-clear.
         APPEND itab.
          INSERT INTO zinv_mov VALUES itab.
        ENDLOOP.
      ENDIF.
Regards,
Line

do like this it may help you..
LOOP AT lt_invmov INTO lw_invmov WHERE check = 'X'.
SELECT MAX( trans )
INTO zinv_mov-trans FROM zinv_mov.
IF sy-subrc EQ 0.
zinv_mov-trans = zinv_mov-trans + '0000000001'.
ELSE.
MOVE '0000000001' TO zinv_mov-trans.
ENDIF.
itab-lifnr = lw_invmov-lifnr.
itab-xblnr = lw_invmov-xblnr.
itab-bukrs = lw_invmov-bukrs.
itab-usnam = zinv_mov-usnam.
itab-appdate = sy-datum.
MOVE 'V2' TO itab-status.
MOVE 'CL' TO itab-clear.
APPEND itab.
ENDLOOP.
INSERT INTO zinv_mov from table itab.
ENDIF.
your itab should be like zinv_mov .
regards
shiba dutta

Similar Messages

  • 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...

  • 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>

  • Problems with INSERT  syntax ?

    Dear programmers,
    I am have a problem with INSERT Syntax,
    I have a table with 11 fields out of which one is auto_increment field(id), Now my problem is, Do i need to specifiy autoincrement field in INSERT statement. I dont thinks ?
    My Insert statement is as follows ,
    int result = st.executeUpdate("insert into tablename"
              +"(name, user_group, lage, preis, anmerkung, exp_uri, timestamp, nummer)"
              +"values +Objekt+"','"+Kategoriekey+"','"+Lage+"','"+Preis+"','"+Anmerkung+"','"+Dateiname+"','"+date.getTime()+"','"+ObjektID+"')");
    thanks in advance
    bye

    The answer to your question is maybe. Each database handles autoincrements differently. What database are you using?
    I also noticed that you are doing an insert using the standard Statement. You should look into using PreparedStatements for performance reasons and issues such as single quotes from within a string.
    Matt

  • Problem with  Creating Info Record

    Hello Gurus,
    I've problem with Creating Info Record
    i tried to create info record for Plant Specific/Purchase Org
    The first Screen General Data is OK
    i entered all the data in the next screen ie
    Purchase Organization Data screen but i'm getting error
    <b>Make an entry in all required fields</b>
    but there is Mandatory Textbox ie "VALID TO" which im unable to select Bcos its Disabled
    pls help me regarding this
    thanks in advance

    Hi
    Have u given the net price. <b>VALID TO</b> is the date until which the price shown in the info record is valid.
    If there is no price that is valid on the current date, the last-valid price is displayed and the date field contains the day before the start of the next validity period (this may be 12.31.9999 if there is no further validity date). If all validit periods lie beyond the current date, the price of the next period is displayed. The date field then contains the end date of this period.
    These validity periods we will maintain Purchse data CONDITIONS while creating info record. Check the validity period for the conditions.
    Hope this will helps u
    Ravi
    Ravikumar Bolla

  • Problem with updating a record method in a database

    I've searched for the forums for info on this to no avail.
    I am connecting to Access database, using the sun.jdbc.odbc.JdbcOdbcDriver.
    I'm trying to be able to update 2 fields in a record (cost & quantity).
    I have an addrecord method, an update method.
    I can use the addrecord and it works great.
    But (yep, there's always a but!), when I try to update only the 1 or 2 fields on a record, I get a message that says "syntax error in UPDATE statement"
    I've written, deleted and re-written code & I'm going nuts.
    Here are my database methods and the actionPerformed where it calls those methods. Is the error message regarding my UPDATE (sql) syntax?
    Why does it work for adding, but not updating?? It seems my 1st if statement under my "update button" is never gone to... so maybe it's just a problem with my "if" statement.
    Please help me before I go crazy! Thanks!
    //flags
    //snippet of code
    private void enableButtons(boolean flag1)
        boolean flag2 = false;
        if (flag1 == false)
           flag2 = true;
        jbtUpdate.setEnabled(flag2); // was flag1 wouldn't work.
        jbtDelete.setEnabled(flag1);
        jbtAdd.setEnabled(flag1);
        jbtFirst.setEnabled(flag1);
        jbtNext.setEnabled(flag1);
        jbtPrev.setEnabled(flag1);
        jbtLast.setEnabled(flag1);
    //...actionperformed(ActionEvent e)
    else if (e.getSource() == jbtAdd)
        jtfItem.requestFocus();
        enableButtons(false);
        jtfItem.setText("");
        jtfDescription.setText("");
        jtfQuantity.setText("");
        jtfCost.setText("");
        addFlag = true;
      else if (e.getSource() == jbtUpdate)
        double quantity1 = parseInt(jtfQuantity.getText());
        double cost1  = parseCurrency(jtfCost.getText());
        Item itemUpdate = new Item(jtfItem.getText(), jtfDescription.getText(),
        cost1, (int)quantity1);
        System.out.println("update button was clicked");
        //first "if"
        if ((jbtUpdate.isEnabled()) && (addFlag == false))
          InventoryDB.updateField(itemUpdate);
          currentItem = itemUpdate;
          System.out.println("it's going to first if stmt");
        //2nd "if"
        if (addFlag == true)
          InventoryDB.addRecord(itemUpdate);
          currentItem = InventoryDB.moveFirst();
          addFlag = false;
          System.out.println("it's going to 2nd if stmt");
        currentItem = itemUpdate;
        performItemDisplay();
        enableButtons(true);
        System.out.println("it's going to last of update code");
    //method snippets  for database manipulation
    public static void addRecord(Item item) throws SQLException
        String query = "INSERT INTO Items (ItemNumber, ItemDescription, UnitCost, Quantity)  " +
            "VALUES ('" + item.getItem() + "', " +
               "'" +        item.getDescr() + "', " +
            "'" +         item.getCost() + "', " +
               "'" +     item.getQuantity() + "')";
        Statement statement = connection.createStatement();
        statement.executeUpdate(query);
        statement.close();
        close();
        open();
      public static void updateField(Item item) throws SQLException
        String query = "Update Items SET " +// Items (ItemNumber, ItemDescription, UnitCost, Quantity) " +
          "VALUES ('" + item.getCost() + "', " +
          "'" +     item.getQuantity() + "', " ;
    //      "WHERE ItemNumber  = " ItemNumber "'"
    //       "WHERE ItemDescription = " ItemDescription "', ";
          Statement statement = connection.createStatement();
          statement.executeUpdate(query);
          statement.close();
          close();
          open();
       public static void updateRecord(Item item) throws SQLException
        String query = "UPDATE Items SET " +
            "ItemNumber  = '" +      item.getItem() + "', " +
            "ItemDescription = '" + item.getDescr() + "', " +
               "UnitCost =  '" +        item.getCost() + "', " +
            "Quantity = '" +     item.getQuantity() + "', " +
            "WHERE ItemNumber = '" + item.getItem() +  "'";
        Statement statement = connection.createStatement();
        statement.executeUpdate(query);
        statement.close();
        close();
        open();
      public static void deleteRecord(String ItemNumber) throws SQLException
        String query = "DELETE FROM Items " +
            "WHERE ItemNumber = '" + ItemNumber + "'";
        Statement statement = connection.createStatement();
        statement.executeUpdate(query);
        statement.close();
        close();
        open();

    not familiar with this syntax,
    public static void updateField(Item item) throws
    s SQLException
    String query = "Update Items SET " +// Items
    ems (ItemNumber, ItemDescription, UnitCost, Quantity)
    " +
    "VALUES ('" + item.getCost() + "', " +
    "'" + item.getQuantity() + "', " ;
    // "WHERE ItemNumber = " ItemNumber "'"
    // "WHERE ItemDescription = " ItemDescription
    public static void updateRecord(Item item) throws
    ws SQLException
    String query = "UPDATE Items SET " +
    "ItemNumber = '" + item.getItem() + "', " +
    "ItemDescription = '" + item.getDescr() + "', " +
    "UnitCost = '" + item.getCost() +
    etCost() + "', " +
    "Quantity = '" + item.getQuantity() + "', " +one ',' too many
    "WHERE ItemNumber = '" + item.getItem() + "'";

  • Problems with inserting elements into vectors

    Hi,
    I have a problem with the setElementAt() method for vectors.
    I want to initialise a vector that is same size as a previous vector declared in my program and insert float 0.0 in all the positions.
    The code below is a for loop to do just this where count is the size of the previous vector.
    for(int i=0;i<count; i++)
                   vLargest.setElementAt(zero,i);
              }i have declared zero as a float
    float zero = 0.0f;
    the error that i'm getting is that it that the vector cannot be applied to a float.
    Can anybody tell me what i'm doing wrong?
    Thanks

    Yes you need to store Objects in your Vector not primitives.
    float is not an Object it is a primitive. But Float is an object.

  • A problem with inserting into DB hebrew strings

    Hi,
    I am working with a 8.1.7 DB version, and use thin driver.
    I have my DB Charest configured to iso 8859P8 (which is visual Hebrew)
    I have no problem in making a connection and retrieving strings, using SELECT * FROM ..
    and then use the ResultSet.getString(String columnName) method .
    I also have no problem in inserting the Hebrew characters , and retrieving them back ( I represent them in a servlet ),
    The only problem I do have, is when I try to insert into DB a row in the following manner
    INSERT into table_name values( Hebrew_String_value1, Hebrew_String_value2, Hebrew_String_value3, Hebrew_String_value4)
    the insertion works fine , but somehow the insertion misplaces the strings order and actually the insertion is in opposite order :
    Hebrew_String_value4, Hebrew_String_value3, Hebrew_String_value2, Hebrew_String_value1.
    If I use the same insert with English Strings , there is no problem.
    does any one have the solution how I insert the strings in the right order ?
    one solution I have is to insert only one column and then update the table for each column , but then , instead of one execute() action , I have to make ,
    1 execute() + 9 executeUpdate() for a 10 column table

    Can you try specify the column order in your INSERT statement, i.e.
    INSERT INTO mytable( column1_name,
                         column2_name,
                         column3_name,
                         column4_name )
                 VALUES( column1_string,
                         column2_string,
                         column3_string,
                         column4_string)My wild guess, though I can't understand why at the moment, is that there may be a problem because Hebrew is read from right to left, that may be causing a problem.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • I'm having a problem with inserting a photo gallery created with Bridge

    I sure could use some help.
    Adobe Bridge - Why do I have a white bar on my page?
    I am using windows vista, Dreamweaver cs4 and Adobe bridge to insert a photo gallery.
    I am using an I-frame to embed a photo gallery that was created with Adobe Bridge CS4. Adobe Bridge instructed me to make the i-frame height = 75% of the width. The code is <iframe src="PhotoAlbum/index.html" width="900" height="675" frameborder="0"></iframe>
    my css places the album in #photoalbum.
    #photoAlbum contains the i-frame with the following properties:
    #photoAlbum {
    margin-top: 20px;
    margin-right: auto;
    margin-bottom: 0px;
    margin-left: auto;
    width: 900px;
    text-align: center;
    padding-top: 20px;
    padding-bottom: 20px;
    border-top-width: 2px;
    border-top-style: groove;
    border-top-color: #333;
    I tried changing the width to 960, 900, 850 etc with no success.
    I have tried making the background of #photoAlbum black with no success.
    The link to the photo album is http://www.gigharborrealestate.com/smith/PhotoAlbum/index.html and shows no white bar.
    The site that I am having problems with is http://www.gigharborrealestate.com/smith On the right side of the Point Richmond Photo Gallery is a white vertical bar.  If you go to /PhotoAlbum/index.html there is no white bar.
    Why does this bar show up when /PhotoAlbum/index.html is put into an I-frame? How can I get rid of the vertical bar?

    insert the following into your code,
    scrolling="no"
    it should look like this
    <div id="gallery"><iframe src="IMAGES/Adobe Web Gallery/index.html"  scrolling="no" width="730" height="555" frameborder="0" name="web_gallery" style="background-color: #D8D9B4"></iframe></div>
    hope it helps, good luck

  • Problem with Retrieving Parent records

    Hi
    I am facing some problem with Relation ship tables
    I am able to retrieve all child relation record by using Parent record id, but the other why around is not working that is
    I am unable to retrieve  all parent records by using a child record.
    Please can you help out this..
    find the below sample method which i was trying
    public HashMap<String, Record[]> getMemberRecords(Record[] rec,
                   RetrieveRelationshipsCommand relation,
                   RepositorySchemaEx repositorySchema, String code,
                   HashMap<String, Record[]> returnMap) throws MDMException {
              LOG.debug("calling getMemberRecords");
              HashMap<String, Record[]> returnVal = returnMap;
              LOG.debug("Assigning returnType to default HashMap.");
              try {
                   for (int recordCount = 0; recordCount < rec.length; recordCount++) {
                        LOG.debug("For recordCount = " + recordCount);
                        Record tempRec = rec[recordCount];
                        relation.setAnchorRecord(tempRec);
                        LOG.debug(" setting AnchorRecord = " + tempRec);
                        relation.setLoadRecords(true);
                        LOG.debug(" setting LoadRecords = " + true);
                        relation.setGetChildren(false);
                        LOG.debug(" setGetChildren has setup with  = " + true);
                        relation.setAnchorRecordId(tempRec.getId());
                        LOG.debug(" setting AnchorRecordId = " + tempRec.getId());
                        relation.setRelationshipId(repositorySchema
                                  .getRelationshipId(code));
                        LOG.debug("Before execution relation execute.");
                        relation.execute();
                        LOG.debug("After execution relation execute.");
                        RelationshipGroup group = relation.getRelationshipGroup();
                        LOG.debug("Retrieved Relationship Group.");
                        Relationship[] relat = group.getMembers();
                        LOG.debug("Length = "+relat.length);
                        Record[] tempRecords = null;
                        if (relat != null) {
                             int length = relat.length;
                             LOG.debug("Length = "+length);
                             tempRecords = new Record[length];
                             for (int count = 0; count < length; count++) {
                                  tempRecords[count] = relat[count].getMemberRecord();
                        if (tempRecords != null) {
                             LOG
                                       .info("Records size is not equal to Null So Calling recursive getMemberRecords.");
                             returnMap = getMemberRecords(tempRecords, relation,
                                       repositorySchema, code, returnMap);
                        LOG
                                  .debug("Setting HashMap Value Values with Parent ID, records[]");
                        returnVal.put(tempRec.getId().getString(), tempRecords);
              } catch (SessionException se) {
                   MDMException exception = new MDMException();
                   ErrorContext ec = new ErrorContext();
                   ec.setErrorMessage(se.getMessage());
                   ec.setErrorCode("MetadataException : " + se);
                   LOG.fatal(se, se.getCause());
                   se.printStackTrace();
                   exception.setContext(ec);
                   throw exception;
              } catch (IllegalArgumentException iae) {
                   MDMException exception = new MDMException();
                   ErrorContext ec = new ErrorContext();
                   ec.setErrorMessage(iae.getMessage());
                   ec.setErrorCode("MetadataException : " + iae);
                   LOG.fatal(iae, iae.getCause());
                   iae.printStackTrace();
                   exception.setContext(ec);
                   throw exception;
              } catch (CommandException ce) {
                   MDMException exception = new MDMException();
                   ErrorContext ec = new ErrorContext();
                   ec.setErrorMessage(ce.getMessage());
                   LOG.fatal(ce, ce.getCause());
                   ce.printStackTrace();
                   exception.setContext(ec);
                   throw exception;
              LOG.debug("Before returning from getMemberRecords");
              return returnVal;

    Hi
    I am facing some problem with Relation ship tables
    I am able to retrieve all child relation record by using Parent record id, but the other why around is not working that is
    I am unable to retrieve  all parent records by using a child record.
    Please can you help out this..
    find the below sample method which i was trying
    public HashMap<String, Record[]> getMemberRecords(Record[] rec,
                   RetrieveRelationshipsCommand relation,
                   RepositorySchemaEx repositorySchema, String code,
                   HashMap<String, Record[]> returnMap) throws MDMException {
              LOG.debug("calling getMemberRecords");
              HashMap<String, Record[]> returnVal = returnMap;
              LOG.debug("Assigning returnType to default HashMap.");
              try {
                   for (int recordCount = 0; recordCount < rec.length; recordCount++) {
                        LOG.debug("For recordCount = " + recordCount);
                        Record tempRec = rec[recordCount];
                        relation.setAnchorRecord(tempRec);
                        LOG.debug(" setting AnchorRecord = " + tempRec);
                        relation.setLoadRecords(true);
                        LOG.debug(" setting LoadRecords = " + true);
                        relation.setGetChildren(false);
                        LOG.debug(" setGetChildren has setup with  = " + true);
                        relation.setAnchorRecordId(tempRec.getId());
                        LOG.debug(" setting AnchorRecordId = " + tempRec.getId());
                        relation.setRelationshipId(repositorySchema
                                  .getRelationshipId(code));
                        LOG.debug("Before execution relation execute.");
                        relation.execute();
                        LOG.debug("After execution relation execute.");
                        RelationshipGroup group = relation.getRelationshipGroup();
                        LOG.debug("Retrieved Relationship Group.");
                        Relationship[] relat = group.getMembers();
                        LOG.debug("Length = "+relat.length);
                        Record[] tempRecords = null;
                        if (relat != null) {
                             int length = relat.length;
                             LOG.debug("Length = "+length);
                             tempRecords = new Record[length];
                             for (int count = 0; count < length; count++) {
                                  tempRecords[count] = relat[count].getMemberRecord();
                        if (tempRecords != null) {
                             LOG
                                       .info("Records size is not equal to Null So Calling recursive getMemberRecords.");
                             returnMap = getMemberRecords(tempRecords, relation,
                                       repositorySchema, code, returnMap);
                        LOG
                                  .debug("Setting HashMap Value Values with Parent ID, records[]");
                        returnVal.put(tempRec.getId().getString(), tempRecords);
              } catch (SessionException se) {
                   MDMException exception = new MDMException();
                   ErrorContext ec = new ErrorContext();
                   ec.setErrorMessage(se.getMessage());
                   ec.setErrorCode("MetadataException : " + se);
                   LOG.fatal(se, se.getCause());
                   se.printStackTrace();
                   exception.setContext(ec);
                   throw exception;
              } catch (IllegalArgumentException iae) {
                   MDMException exception = new MDMException();
                   ErrorContext ec = new ErrorContext();
                   ec.setErrorMessage(iae.getMessage());
                   ec.setErrorCode("MetadataException : " + iae);
                   LOG.fatal(iae, iae.getCause());
                   iae.printStackTrace();
                   exception.setContext(ec);
                   throw exception;
              } catch (CommandException ce) {
                   MDMException exception = new MDMException();
                   ErrorContext ec = new ErrorContext();
                   ec.setErrorMessage(ce.getMessage());
                   LOG.fatal(ce, ce.getCause());
                   ce.printStackTrace();
                   exception.setContext(ec);
                   throw exception;
              LOG.debug("Before returning from getMemberRecords");
              return returnVal;

  • Problem with inserting date

    Hi,
    I have a JSP form that takes the date and inserts it into the db. I'm having a problem with what format the date should be in. My insert string looks like
    INSERT INTO users (USERNAME, WHO_CREATED, WHEN_CREATED) VALUES ('bob', 'jeff', (Result.getString("sysdate"))
    unfortunatly whatever format I put the date in I can't seem to make both JAVA and ORACLE happy.
    I'm new at this so I'm hoping that is something simple.
    Thanks,
    Chris
    null

    Hi Chris,
    Are u using Business components for java i.e. entity/view objects? If yes, then the default date format for entity/ view objects is
    "yyyy-mm-dd".
    Aparna.

  • Problem with insert or update when object has a forigne key

    Greetings
    I am using toplink and something wierd is going on. On one of our servers we have a table "t" that has a foreign key. We are seeing errors when we work on "t" that seem to be toplink trying to "re-insert" the record in the FK. My explanation may be lacking, I am sorry for that, but I would be greatful for any help I could get. A stack trace follows:
    Caused by: javax.faces.el.EvaluationException: Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00001: unique constraint (ACCESS_D.UEA_PROVIDERS_PK) violated
    Error Code: 1
    Call:INSERT INTO UEA_PROVIDERS (PROVIDER_ID, NAME, CONVERSION_STRING, AVAILABLE_TO_PUBLIC) VALUES (16.0, 'US Cellular', '[email protected]', 'Y')
    Query:InsertObjectQuery(eac.model.UeaProviders@1c37b26)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:150)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
         ... 23 more
    I am not inserting any records into UEA_PROVIDERS but still toplink seems to be trying to. Is there something I can do to stop this behavior. It only appears on this one server and it seems to go across applications..
    thanks
    troy

    This is most likely an issue with your UnitOfWork usage. How are you registering the objects in the TopLink UnitOfWork and updating them? Are you using the mergeClone() API?
    Ensure that you are first reading the objects your are modifying through the UnitOfWork, and modifying the UnitOfWork clones.
    If you are using the mergeClone API, ensure your descriptor's does-exist policy is correct. You may need to use the does-exist option check-database if the related objects to the object being merged have not been read into the session's cache.

  • Keyboard problems with insert button

    Hi, I'm having problems wih the insert button. It doesnt work when i press to activate it. However, this button is also used with the function key to toggle scroll lock which works. What is the problem? Is my labtop defective? I also have this problem with my desktop keyboard. Is it some kinda setting that I disabled because it worked on my desktop keyboard a few days ago and I don't remember setting any different preferences.
    My labtop is the the U550. It is 2 days old.

    Quote from: mild0d on 21-July-12, 03:01:44
    Has anyone had any problems with their keyboard? I bought a gt60 back in april. Everthing with the laptop has been great except for the "W" key. It works fine typeing but in a game and trying to go forward it will stop working and I will have to repress. I also noticed that if I have just used the keyboard and stop using it for a minute it will make this crackling sound. It has freaked me out a couple times.
    Regardless, if it was any other key I would have had no problem but it is pretty much my main gaming key. I RMA'ed through msi and sent it off tuesday. Had anyone had any experience with MSI laptop rma service?   I am just wanting to know what type of turn around time i will have?
    Having the exact same issue with my GT60  :-(

  • Problems with inserted datagridview checkbox column

    I have a few problems with a checkbox column added to a datagridview. The datagridview is bound by a binding source whose datasource is a datatable. I also add in the code a checkbox column:
    private
    void InitializeDataGridView()
                dgvInvoices.ColumnHeadersDefaultCellStyle.Font =
    new Font("Arial", 10,
    FontStyle.Bold);
    DataGridViewCheckBoxColumn chkColumn =
    new DataGridViewCheckBoxColumn();
                chkColumn.FlatStyle =
    FlatStyle.Standard;
                dgvInvoices.Columns.Insert(0, chkColumn);
                dgvInvoices.DataSource = bs;
                cmbInvoicingCriteria.Text =
    "(All)";
    DataGridViewBinding.CreateColumn(dgvInvoices,
    "Date", "Date",
    DataGridViewContentAlignment.MiddleLeft);
    DataGridViewBinding.CreateColumn(dgvInvoices,
    "Invoice", "Invoice",
    DataGridViewContentAlignment.MiddleLeft);
    DataGridViewBinding.CreateColumn(dgvInvoices,
    "Customer", "Customer");
    DataGridViewBinding.CreateColumn(dgvInvoices,
    "Name", "Name");
    DataGridViewBinding.CreateColumn(dgvInvoices,
    "Count", "Count");
    DataGridViewBinding.CreateColumn(dgvInvoices,
    "Total", "Total");
    DataGridViewBinding.CreateColumn(dgvInvoices,
    "Driver", "Driver");
    DataGridViewBinding.CreateColumn(dgvInvoices,
    "Status", "Status");
    DataGridViewBinding.CreateColumn(dgvInvoices,
    "ARHID", "ARHID");
    DataGridViewBinding.CreateColumn(dgvInvoices,
    "AR", "AR");
                dgvInvoices.Columns["ARHID"].Visible =
    false;
                dgvInvoices.Columns["AR"].Visible =
    false;
    this.dgvInvoices.Columns[0].DefaultCellStyle.Font =
    new Font("Arial", 18,
    FontStyle.Bold);
    this.dgvInvoices.Columns["Date"].DefaultCellStyle.Font =
    new Font("Arial", 10,
    FontStyle.Bold);
    this.dgvInvoices.Columns[2].DefaultCellStyle.Font =
    new Font("Arial", 10,
    FontStyle.Bold);
    this.dgvInvoices.Columns["Customer"].DefaultCellStyle.Font =
    new Font("Arial", 10,
    FontStyle.Bold);
    this.dgvInvoices.Columns["Name"].DefaultCellStyle.Font =
    new Font("Arial", 10,
    FontStyle.Bold);
    this.dgvInvoices.Columns["Count"].DefaultCellStyle.Font =
    new Font("Arial", 10,
    FontStyle.Bold);
    foreach (DataGridViewColumn dc
    in dgvInvoices.Columns)
                    dc.ReadOnly =
    true;
    if (dc.HeaderText.ToLower() ==
    "count" || dc.HeaderText.ToLower() ==
    "name" || dc.Index == 0)
    this.dgvInvoices.Columns[dc.Index].AutoSizeMode =
    DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
    else
    this.dgvInvoices.Columns[dc.Index].AutoSizeMode =
    DataGridViewAutoSizeColumnMode.Fill;
                dgvInvoices.DefaultCellStyle.Alignment =
    DataGridViewContentAlignment.MiddleCenter;
                dgvInvoices.Columns[0].ReadOnly =
    false;
                dgvInvoices.Columns[0].Width = 25;
                dgvInvoices.Columns[0].SortMode =
    DataGridViewColumnSortMode.Automatic;
    The problems I have here are
    1. The first checkbox doesn't check off (it used to work when the width was 25 but then I added the code ontop to make the autosize mode of this columns to allcellscellsexcept header it stopped working. I need that though because if I don't make the autosizemode
    = all cells except header then when I make the form narrow the checkbox column disappears.) I was wondering why this is happening, and how to fix it.
    2. Also this column is not sortable. I added to my code  dgvInvoices.Columns[0].SortMode = DataGridViewColumnSortMode.Automatic;
    but it doesn't seem to work.
    3. Whenever I sort another column the checked off checkboxes lose their focus. I understand that can be a problem with a bound datagridview and one unbound column, but how can I fix it?
    Debra has a question

    I loaded the data for all the rows from a datatable on the form. The checkbox column is that connected to that bound data. it's just there and I need to be able to tell if each row was checked or not, and I need to be able to sort the checkbox column. I
    also need to be able to sort all the other columns without losing the check. The only thing commenting out the foreach would help would be that the first checkbox can be checked, but I want it to be autosizemode = allcellsexceptheader and I want to understand
    why it's not working like this. Would you have any ideas? Below is how I bound the datagridview for all columns except the checkbox column.
            private
    void LoadDataGridView()
    DataGridViewBinding.BindWithData(false, dsInvoicingFilter.Tables[0], dgvInvoices, lblEntryCount, bs);
    if (dsInvoicingFilter.Tables[0].Rows.Count == 0)
                    btnDelete.Enabled =
    false;
                    btnOpenInvoice.Enabled =
    false;
                    btnPrint.Enabled =
    false;
                    btnSaveAsInvoice.Enabled =
    false;
                    btnVoid.Enabled =
    false;
                    btnShip.Enabled =
    false;
    else
                    btnDelete.Enabled =
    true;
                    btnOpenInvoice.Enabled =
    true;
                    btnPrint.Enabled =
    true;
                    btnSaveAsInvoice.Enabled =
    true;
                    btnVoid.Enabled =
    true;
                    btnShip.Enabled =
    true;
                    bs.Position = 0;
                dgvInvoices.Columns[0].Width = 25;
                txtSearch.Text =
    public static
    void BindWithData(bool autoGenerateColumns,
    DataTable datatable,
    DataGridView datagridview, Label lblDGVEntryCount,
    BindingSource bs)
                datagridview.AutoGenerateColumns = autoGenerateColumns;
                bs.DataSource = datatable;
                datagridview.DataSource = bs;
                DataGridViewEntryCount(datagridview, lblDGVEntryCount);
    //ExpandColumns(datagridview);//to do it slows it down. Why can't the dgv remember to do it from when initialized it?
    Debra has a question

  • CFFileUpload with inserting a record

    Hi guys,
    I'm bumping into the wall with this one. What i'm trying to do is using cffileupload tag upload multiple files, resize and rename them, and then insert into database the file name. All goes well until the last bit (insert into database). Have no clue where it goes wrong hence a call for help.
    <cffileupload url="process.cfm?id=#URL.upd#" align="center" width="700" maxuploadsize = "200" progressbar = "true" bgcolor="white" oncomplete="printFileName" />
    process.cfm:
    <cfparam name="URL.id" default="1">
    <cfquery name="get_photos" datasource="IGES">
    SELECT *
    FROM event_photos
    WHERE event_id = <cfqueryparam value="#URL.id#" cfsqltype="cf_sql_numeric">
    ORDER BY id DESC
    </cfquery>
    <cfset currentDirectory = #expandPath("../images/events/#URL.id#/")#>
    <cfif DirectoryExists(currentDirectory)>
    <cfelse>
    <cfdirectory action="Create" directory="#expandPath("../images/events/#URL.id#/")#" mode="777">
    </cfif>
    <cffile 
        action = "upload"
        destination = "#expandpath('../images/events/#URL.id#/')#"
        nameconflict="makeunique"
        >
    <cfimage action="resize"
    width="640"
    height="480"
    source="#expandpath("../images/events/#URL.id#/#file.serverfile#")#"
    destination="#expandpath("../images/events/#URL.id#/#file.serverfile#")#"
    overwrite="yes">
    <cffile action = "rename"
       source="#expandpath("../images/events/#URL.id#/#file.serverfile#")#"
    destination="#expandpath("../images/events/#URL.id#/5.jpg")#">
    <cfquery name="newrecord" datasource="iges" >  
        INSERT INTO event_photos (photo)
    VALUES ("3")
    </cfquery>
    What happens is it uploads the file, resizes it, renames it and then gives me "status code = 50" error. What am I doing wrong? photo field in database is integer.
    cheers,
    Simon

    Hi Cameron,
    I suppose to insert an event id and photo name. it's just one of the attempts (with the 3). sorry for confusion. Anyway. What I have discovered so far is absolutely hard to explain, as today couple of times it actually went through and inserted the record.
    It seems that for some reason it doesn't want to execute any sort of query. The query at the beginning doesn't produce any results either. (though time to time it works). I just found out that in order to pass to parameters via url you have to enclose it like this :
    <cfset request.theURLVars = urlEncodedFormat("a=1&b=2&c=3") />
    otherwise flash cuts out everything after first parameter. Maybe it's something related?
    anyway, so far I'm clueless and seeking (shouting) for help as it drives me mad!

Maybe you are looking for

  • Closing Terminal window tabs shrinks Terminal window height

    Open a Terminal window, press Command-T to create a tab, and then Ctrl-D to close that new tab, the Terminal window height decreases by one row. This most certainly appears to be a bug. How do I report this to Apple?

  • Photoshop/illustrator transfer issues and error

    I've transferred my photoshop and illustrator from my old mac to another by using time machine, and I deregistered my old accounts on my old laptop to use it on my new set-up, but unfortunately I keep receiving 150:30 errors. I've tried scouring the

  • BuffferWriter dosen't write in case statement

    Hi all, In the following code snippet below, bufferwriter does no write "***Choice not found" In the logfile can anyone explain why? When bufferWriter is called outside the case statement , the file is written to i.e. "Opened Log File" and 'Closed Lo

  • Spry xml dataset / IE / Phatfusion Multibox

    I try to use spry xml data set with phatfusion multibox. I use multibox script to open a PHP page with query string insides spry:region. It has problem on this application on IE either 6 and 7. But works fine in Firefox The requested php page just op

  • PAN Number Display in MIRO/FB60

    Hi Expert My Client wants PAN Number to be appear at the time of FB60 and MIRO transaction, Please guide how it can be done ? Regards, GK