Problem in inserting a node in Treeview.

Hi all,
I'm having a problem in inserting a node in the
treeview always it appends in the end of the
sibling.
Basically on double clicking of any node in the
treeview should create a copy of the double clicked
node and just insert the copy of the doubleclicked
node next to the doubleclicked node instead at the end of the sibling.
if i do this it will to the end of all the siblings.
copyObject = l_SelectedNode.Clone();
copyObject.Parent = l_SelectedNode.Parent;
instead of next to it.
I am trying something like this:
RootNode
|
---CHILD Sibling Node1
| |
----GrandChild1Sibling1
| |
---GrandChild1Sibling2 <<-- double clicking
(GrandChild1Sibling2)
| |
<<-- it must add
(GrandChild1Sibling2_copy)
---GrandChild1Sibling3
| |
---GrandChild1Sibling4
| << -- But it is adding a copy here
at the end of all sibbling..
|
---CHILD Sibling Node2
| |
-------GrandChild2Sibling1
| |
------GrandChild2Sibling2
| |
------GrandChild2Sibling3
| |
------GrandChild2Sibling4
|
i am doing GrandChild1Sibling2_copy.parent =
GrandChild1Sibling2.Parent;
it will always add in the end of all the sibling as
(GrandChild1Sibling5_copy) instead of next to
(GrandChild1Sibling3_copy) Just below the GrandChild1Sibling2.
Is there any simple soln or any ordering factor which i should look for.
Thanx in advance...
Regards,
-Prasad

Hello,
Check the following link.
SQL error 1653
Hope it helps in solving your problem.
Thanks and Regards,
Sachin

Similar Messages

  • How to move node in treeView using two buttons ?

    Hello ,
    Am starter , and am working on a Winforms application.
    I browse an XML file , then I populate treeview in my interface. I want to move selected node in the two sens ( up and down)  using two button ( so not with events , normal drag and drop with mouse ) .
    - I select the nod 
    - I click on the up button , then the node take the new place ( something like , drop and insert maybe )
    I don't know if is possible to affect this events to button or they are another way to do this 
    this is my code concerning populating treeView :
    private void browseSourceFileBtn_Click(object sender, EventArgs e)
    var openSourceFile = openSourceFileDialog.ShowDialog();
    if (openSourceFile == DialogResult.OK)
    fichierSourcePath.Text = openSourceFileDialog.FileName;
    // Connect the XML FILE DATABASE to the application interface
    private void button1_Click(object sender, EventArgs e)
    if (openSourceFileDialog.FileName == String.Empty)
    MessageBox.Show("u should open a file", "Erreur de chargement", MessageBoxButtons.OK, MessageBoxIcon.Error);
    else
    try
    MessageBox.Show("plz wait ");
    statusLabel.Text = "Début de chargement du fichier";
    var doc = new XmlDocument();
    doc.Load(openSourceFileDialog.FileName);
    sourceTreeView.Nodes.Clear();
    var rootNode = new TreeNode(doc.DocumentElement.Name);
    sourceTreeView.Nodes.Add(rootNode);
    sourceTreeView.CheckBoxes = true;
    sourceTreeView.AllowDrop = true;
    DateTime starteTime = DateTime.Now;
    BuildNode(doc.DocumentElement, rootNode);
    DateTime endTime = DateTime.Now;
    TimeSpan duree = endTime - starteTime;
    sourceTreeView.ExpandAll();
    sourceTreeView.Nodes[0].EnsureVisible();
    string chargementTemps = "" + duree.Minutes + "min : " + duree.Seconds + "s : " + duree.Milliseconds + "ms";
    statusLabel.Text = "Chargement effectué avec succés en :" + chargementTemps;
    catch (Exception)
    sourceTreeView.Nodes.Clear();
    statusLabel.Text = "Echec de chargement";
    thanks u a lot 

    Hi Nico68er,
    According to your description, you'd like to move up or down the node in TreeView.
    By reseraching, I found this post in StackOverFlow is similar with your issue.http://stackoverflow.com/questions/2203975/move-node-in-tree-up-or-down
    From this answer.
    You can use the following extensions
    public static class Extensions
    public static void MoveUp(this TreeNode node)
    TreeNode parent = node.Parent;
    TreeView view = node.TreeView;
    if (parent != null)
    int index = parent.Nodes.IndexOf(node);
    if (index > 0)
    parent.Nodes.RemoveAt(index);
    parent.Nodes.Insert(index - 1, node);
    else if (node.TreeView.Nodes.Contains(node)) //root node
    int index = view.Nodes.IndexOf(node);
    if (index > 0)
    view.Nodes.RemoveAt(index);
    view.Nodes.Insert(index - 1, node);
    public static void MoveDown(this TreeNode node)
    TreeNode parent = node.Parent;
    TreeView view = node.TreeView;
    if (parent != null)
    int index = parent.Nodes.IndexOf(node);
    if (index < parent.Nodes.Count -1)
    parent.Nodes.RemoveAt(index);
    parent.Nodes.Insert(index + 1, node);
    else if (view != null && view.Nodes.Contains(node)) //root node
    int index = view.Nodes.IndexOf(node);
    if (index < view.Nodes.Count - 1)
    view.Nodes.RemoveAt(index);
    view.Nodes.Insert(index + 1, node);
    Child nodes will follow their parents.
    You could use this class in your program.
    If you want to move the node up. Call the Extensions.MoveUp(this.treeView1.SelectNode)
    private void button1_Click(object sender, EventArgs e)
                if (this.treeView1.SelectedNode != null)
                    Extensions.MoveUp(this.treeView1.SelectedNode);
    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.

  • Inserting a node in XML and retaining the doc type

    Hi All,
    I want to insert one new node in an XML. Using the following code I can do that. But the problem is if the XML has doc type declaration then its giving me problem. After inserting the node the transformer is removing my doc type declaration from the XML. I have to retain the doc type definition (including entity declaration) as it is in the original XML file.
    The following is the code that I'm using.
    Document vDoc = null;
    try {
    // Contruct the DOM document
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    vDoc = builder.newDocument();
    Node vFormNode = vDoc.createElement("Form");
    vDoc.appendChild(vFormNode);
    // Convert into a String the DOM document
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer();
    DOMSource source = new DOMSource(vDoc);
    StringWriter sw = new StringWriter();
    StreamResult result = new StreamResult(sw);
    transformer.transform(source, result);
    catch (Exception e) {
    System.out.println("Error: " + e.getMessage());
    }The doc type def. in the original file is some thing like this.
    <!DOCTYPE article SYSTEM "someurl/TFJA.dtd"[
    <!ENTITY T0001 SYSTEM ".\BTN_A_000112809_O_XML_IMAGES\BTN_A_000112809_O_T0001.gif" NDATA GIF>
    <!ENTITY F0001 SYSTEM ".\BTN_A_000112809_O_XML_IMAGES\BTN_A_000112809_O_F0001g.gif" NDATA GIF>
    <!ENTITY F0002 SYSTEM ".\BTN_A_000112809_O_XML_IMAGES\BTN_A_000112809_O_F0002g.jpg" NDATA JPEG>
    ]>I know that I can set up the doc type definition in the new XML using the following properties of the transformer.
    transformer.setOutputProperty( OutputKeys.DOCTYPE_SYSTEM,"article" );
    transformer.setOutputProperty( OutputKeys.DOCTYPE_PUBLIC,"my DTD def");
    I cannot hard code the DTD def. as it can vary from one XML to another. Using doc.getDocType() I can get the doctype of the original XML. But is it is not returning the complete def. including entities declaration. Its giving me "someurl/TFJA.dtd".
    Is there any way to retain the complete doc type in the original XML file? I don't have much experience in XML and this issue is eating my head.. Also do I have to modify the DTD to accommodate the new tags added in order to make it a valid XML?
    Any help and sample code would be highly appreciated.

    Hi,
    I also had similar requirement and when searching i came across this post. Later i found the solution for this. Instead of hardcoding the doctype you can get it from Document as follows..Snippet from the code i used..
    DocumentType doctype = document.getDoctype();
    if(doctype != null) {
                   String id = doctype.getSystemId();
                   if(id == null || id.length() == 0)
                        return;
                   transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, id);
                   id = doctype.getPublicId();
                   if(id == null || id.length() == 0)
                        return;
                   transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, id);
    Hope this helps.
    Regards,
    Deepak

  • [Win/CS3] Problem with tree view nodes display In Release Version of InDesign

    b [Win/CS3]
    Hi All,
    I am Facing a problem from last few days.I have a dialog on which i have a treeview ListBox.I am filling this listBox dynamically.On a Button click Event.
    My requirement is to show Some text value on the node and Index value on the back end.So When i select String1 the index1 should be Selected.
    b This Listbox is working fine ON Debug Version. But Crashing On Release Version.That seems Strange to me..........?????????
    b in DialogObserver::Update on button click event
    NodeID node = IDCGridNodeID::Create(IndexX);
    treeMgr->NodeAdded(node);
    b and in TreeviewMgr::ApplyDataToWidget
    TreeNodePtr<IDCGridNodeID> nodeID(node);
    PMString IndexNo= nodeID->GetName();
    I am going to database and retrieving string value according to that
    IndexNo.
    WCHAR Buf[200];// this contains value retrieve from database
    Then i am converting WCHAR[] to CHAR[] BY using
    size_t origsize = wcslen(Buf) + 1 ;
    const size_t newsize = 100;
    size_t convertedChars = 0;
    char nstring[newsize];
    wcstombs_s (&convertedChars, nstring, origsize, buf, _TRUNCATE);
    PMString StringToDisplay(nstring);
    //Till here its working fine
    But when i am setting this value as Node name
    style.Translate();
    setNodeName( widgetList, StringToDisplay, kIDCTVTextWidgetID );
    and function return kTrue; statement executed The application is crashing.
    With error showing
    b INdesign Encountered a problem Needs to close.
    I Am not able to find out why this is not working on Release while it is working fine on debug version..???????????????????
    Is I am missing or Made some changes For release version..????
    Thanks,

    Hi Michael,
    Thanks for your reply.
    The lines
    NodeID node = IDCGridNodeID::Create(IndexX);
    treeMgr->NodeAdded(node);
    are working fine for Both Debug N Release version.The Application Is crashing In tree view manager class as i explained.
    while it works fine without having even a single warning in debug version.
    I read the document and i find out if i want to add node in treeview i have to call
    treeMgr->NodeAdded(node);
    which will call manager
    b and in TreeviewMgr::ApplyDataToWidget
    i am getting my node name as
    TreeNodePtr<IDCGridNodeID> nodeID(node);
    PMString IndexNo= nodeID->GetName();
    I don't think that something is wrong in this but i am not sure becoz i am new in indesign development.
    for adding nodes i referred the SDK examples.I found the same code for adding.

  • Problem in inserting data into MySQL table

    Hi All,
    I have a table with just two fields FIRSTNAME and SECONDNAME in MySQL. I am accepting the First Name and Second Name in two text fields and then trying to insert them into the MySQL table. I have set the concurrency of the rowset to CONCUR_UPDATABLE and am using the code clip for Database row insert with the appropriate changes. When I run the application it doesnt give me any errors but the data is also not inserted in the table. Can someone pls help me out.
    Loneliness wins the race :-)

    This is my problem when inserting single row. What does it means ?
    MusicInsert: com.mysql.jdbc.NotUpdatable: Result Set not updatable.This result set must come from a statement that was created with a result set type of ResultSet.CONCUR_UPDATABLE, the query must select only one table, and must select all primary keys from that table. See the JDBC 2.1 API Specification, section 5.6 for more details

  • Problem while inserting into a table which has ManyToOne relation

    Problem while inserting into a table *(Files)* which has ManyToOne relation with another table *(Folder)* involving a attribute both in primary key as well as in foreign key in JPA 1.0.
    Relevent Code
    Entities:
    public class Files implements Serializable {
    @EmbeddedId
    protected FilesPK filesPK;
    private String filename;
    @JoinColumns({
    @JoinColumn(name = "folder_id", referencedColumnName = "folder_id"),
    @JoinColumn(name = "uid", referencedColumnName = "uid", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Folders folders;
    public class FilesPK implements Serializable {
    private int fileId;
    private int uid;
    public class Folders implements Serializable {
    @EmbeddedId
    protected FoldersPK foldersPK;
    private String folderName;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "folders")
    private Collection<Files> filesCollection;
    @JoinColumn(name = "uid", referencedColumnName = "uid", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Users users;
    public class FoldersPK implements Serializable {
    private int folderId;
    private int uid;
    public class Users implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer uid;
    private String username;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "users")
    private Collection<Folders> foldersCollection;
    I left out @Basic & @Column annotations for sake of less code.
    EJB method
    public void insertFile(String fileName, int folderID, int uid){
    FilesPK pk = new FilesPK();
    pk.setUid(uid);
    Files file = new Files();
    file.setFilename(fileName);
    file.setFilesPK(pk);
    FoldersPK folderPk = new FoldersPK(folderID, uid);
         // My understanding that it should automatically handle folderId in files table,
    // but it is not…
    file.setFolders(em.find(Folders.class, folderPk));
    em.persist(file);
    It is giving error:
    Internal Exception: java.sql.SQLException: Field 'folderid' doesn't have a default value_
    Error Code: 1364
    Call: INSERT INTO files (filename, uid, fileid) VALUES (?, ?, ?)_
    _       bind => [hello.txt, 1, 0]_
    It is not even considering folderId while inserting into db.
    However it works fine when I add folderId variable in Files entity and changed insertFile like this:
    public void insertFile(String fileName, int folderID, int uid){
    FilesPK pk = new FilesPK();
    pk.setUid(uid);
    Files file = new Files();
    file.setFilename(fileName);
    file.setFilesPK(pk);
    file.setFolderId(folderId) // added line
    FoldersPK folderPk = new FoldersPK(folderID, uid);
    file.setFolders(em.find(Folders.class, folderPk));
    em.persist(file);
    My question is that is this behavior expected or it is a bug.
    Is it required to add "column_name" variable separately even when an entity has reference to ManyToOne mapping foreign Entity ?
    I used Mysql 5.1 for database, then generate entities using toplink, JPA 1.0, glassfish v2.1.
    I've also tested this using eclipselink and got same error.
    Please provide some pointers.
    Thanks

    Hello,
    What version of EclipseLink did you try? This looks like bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=280436 that was fixed in EclipseLink 2.0, so please try a later version.
    You can also try working around the problem by making both fields writable through the reference mapping.
    Best Regards,
    Chris

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

  • 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

  • Problem on inserting text from file to a clob column

    Hi! I'm having problem in inserting text read from a text file to a clob column in my table.
    Here's my code
    public void addSyllabusOutline(int syllid)
              CLOB objclob1 = null;
              CLOB objclob2 = null;
              String query = "SELECT outline, projoutline FROM Syllabus WHERE syllabusid = '"+ syllid +"' FOR UPDATE";
              try
                   System.out.print("Getting syllabus outline and projoutline clob locator...");
                   DBConnection dbconnbean = new DBConnection();
                   dbconnbean.openConnection();
                   ResultSet rst = dbconnbean.executeQuery(query);
                   if(rst.next())
                        objclob1 = (oracle.sql.CLOB)rst.getClob("outline");
                        objclob2 = (oracle.sql.CLOB)rst.getClob("projoutline");
                        Writer clobwriter1 = ((oracle.sql.CLOB)objclob1).getCharacterOutputStream();
                        String filename1 = "c:\\o1u2t3l4i5n6e7.txt";
                        File outlinefile1 = new File(filename1);
                        FileReader outlineFileReader1 = new FileReader(outlinefile1);
                        char[] cbuffer1 = new char[10 * 1024];
                        int nread1 = 0;
                        while((nread1 = outlineFileReader1.read(cbuffer1)) != -1)
                             clobwriter1.write(cbuffer1, 0, nread1);
                        //clobwriter1.flush();
                        clobwriter1.close();
                        Writer clobwriter2 = ((oracle.sql.CLOB)objclob2).getCharacterOutputStream();
                        String filename2 = "c:\\p1r2o3j4o5u6t7l8i9n0e.txt";
                        File outlinefile2 = new File(filename2);
                        FileReader outlineFileReader2 = new FileReader(outlinefile2);
                        char[] cbuffer2 = new char[10 * 1024];
                        int nread2 = 0;
                        while((nread2 = outlineFileReader2.read(cbuffer2)) != -1)
                             clobwriter2.write(cbuffer2, 0, nread2);
                        //clobwriter2.flush();
                        clobwriter2.close();
                   System.out.println("done");
                   dbconnbean.closeConnection();
              catch(Exception e)
                   System.out.println("Error: " + e);
    My error is java.sql.SQLException fetch out of sequence. I don't have an Idea on what seems to be the problem. Please help.. Thank you very much. ^_^

    Hi,
    Print the whole stack trace. It will tell you the line which causes the error. How you use clob and blob in oracle is also version dependent. Try to google for
    oracle "your version" java clob example.
    /Kaj

  • Problem in Insertion into table through After Report Parameter form trigger

    Hi All,
    I am getting problem in inserting some data into temp table through Report.
    My requirement is like that, I have to do a calculation based on user parameters, and then insert the data into the temp table. I wanted to do this into After Report Parameter form trigger function. I have done all the calculation and wrote all the insert statement in that function. There is no problem in compilation. then I am taking value from this temp table in my formula columns.
    When I run this report, it hangs, don't understand what is the problem.Can anybody help me out in this.
    Thanks,
    Nidhi

    The code is as follows:
    function AfterPForm return boolean is
    CURSOR CUR_RECEIPT(RECEIPT_NUM_FROM NUMBER, RECEIPT_NUM_TO NUMBER) IS
    SELECT DISTINCT receipt, item_no FROM xxeeg.xxeeg_1229_sp_putaway WHERE RECEIPT BETWEEN
    RECEIPT_NUM_FROM AND RECEIPT_NUM_TO ;
    V_CUR_RECEIPT CUR_RECEIPT%ROWTYPE;
    begin
    OPEN CUR_RECEIPT(:RECEIPT_NUM_FROM, :RECEIPT_NUM_TO);
    FETCH CUR_RECEIPT
    INTO V_CUR_RECEIPT;
    LOOP
    EXIT WHEN CUR_RECEIPT%NOTFOUND;
    IF V_CUR_RECEIPT.ITEM_NO = 'TEST1' AND V_CUR_RECEIPT.RECEIPT = '12' THEN
    INSERT INTO SP_TEMP
    (RECEIPT, ITEM_NO, LOCATION1)
    VALUES
    (V_CUR_RECEIPT.RECEIPT, V_CUR_RECEIPT.ITEM_NO, 10);
    UPDATE SP_TEMP
    SET LOCATION2 = 12
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
    UPDATE SP_TEMP
    SET LOCATION3 = 13
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
    UPDATE SP_TEMP
    SET LOCATION4 = 14
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
    ELSE
    IF V_CUR_RECEIPT.ITEM_NO = 'TEST2' AND V_CUR_RECEIPT.RECEIPT = '12' THEN
    INSERT INTO SP_TEMP
    (RECEIPT, ITEM_NO, LOCATION1)
    VALUES
    (V_CUR_RECEIPT.RECEIPT, V_CUR_RECEIPT.ITEM_NO, 10);
    UPDATE SP_TEMP
    SET LOCATION2 = 16
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
    UPDATE SP_TEMP
    SET LOCATION3 = 17
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO =V_CUR_RECEIPT.ITEM_NO;
    UPDATE SP_TEMP
    SET LOCATION4 = 18
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
    ELSE
    INSERT INTO SP_TEMP
    (RECEIPT, ITEM_NO, LOCATION1)
    VALUES
    (V_CUR_RECEIPT.RECEIPT, V_CUR_RECEIPT.ITEM_NO, 10);
    UPDATE SP_TEMP
    SET LOCATION2 = 19
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
    UPDATE SP_TEMP
    SET LOCATION3 = 20
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO =V_CUR_RECEIPT.ITEM_NO;
    UPDATE SP_TEMP
    SET LOCATION4 = 21
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
    END IF;
    END IF;
    END LOOP;
    COMMIT;
    CLOSE CUR_RECEIPT;
    return(TRUE);
    end;
    .....................................................................................................................

  • Problem to insert  Chinese Characters(GB3212)  into MySQL

    I met a problem to insert Chinese Characters (GB3212) into MySQL using Entity Bean (or JPA).
    For example, when a hardcoded string "{color:#ff0000}&#30005;&#22120;me&#20803;&#20214;{color}" is inserted, it is displayed as "{color:#ff0000}??me??{color}" in MySQL.
    The NamedQuery is also not working for Chinese Characters.
    The setting are as following:
    GlassFish JDBC connection pool: useUnicode=true, charecterEncoding=gb2312
    NetBeans IDE: source encoding set to GB2312;
    MySql table: the column set to CHARACTER SET gb2312;
    Any experts, please give advice
    Thanks lot

    I didn't noticed that there is a {color:#ff0000}sun-resources.xml{color} file under {color:#ff0000}<ejb project>/server resources{color}.
    This file has a pool configuration. This config just overwite the paremeter i added using Admin Console every time a client is lauched. So there are two option to fix this problem.
    1. Insert the follwowing two lines into the {color:#ff0000}sun-resources.xml{color}
    <property name="characterEncoding" value="gb2312"/>
    <property name="useUnicode" value="true"/>
    2. delete the everthing in the {color:#ff0000}sun-resources.xml, using Admin Console {color}config your own pool & DataSource
    I tried first option & it works.

  • Inserting a node between two existing nodes not tworking!

    According to the user manual, I should be able to insert a node between two other nodes by dragging and dropping when the input knot is highlighted. I have never been able to get this to work. Anyone have any suggestions??

    FYI:
    http://discussions.apple.com/help.jspa#answers
    Patrick

  • Inserting root node to enable 1...n

    I am doing IDOC - file scenario
    I have a DT already created at the receiver end
    what do I have to do inorder to recieve mutliple instances of IDOC in receiver ( 1.... n  )?
    I am planning to create a root node with 1...1 and make the fileds 0...unbound
    is this gonna work ?
    if yes, please let me know how do I insert a node in the root level
    thanks,
    venkat.

    Hi,
    You cannot directly insert an element at the root level. You have to recreate the whole datatype.
    Regards,
    Sudheer.

  • 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

  • Could someone help me out how to insert a Node properly into a DOM?

    I am trying to insert a Node built from a String to a DOM.
    Here is how I created the Node
                   Detail = "<Detail><Msg>Detail Message</Msg></Detail>";
                   prolog = "<?xml version="1.0" encoding="UTF-8"?>";
                   Node DetailNode = null;
                   Document DetailDoc = null;
                   if( Detail != null ){
                        Detail = prolog + BiometricDetail;
                        DetailDoc = xp.XML2DOM( BiometricDetail ); // transform a XML String into a DOM.
                        DetailNode = BiometricDetailDoc.getDocumentElement();                    
    Here is how I created the DOM
                   javax.xml.parsers.DocumentBuilderFactory factory = javax.xml.parsers.DocumentBuilderFactory.newInstance();
                   javax.xml.parsers.DocumentBuilder builder = factory.newDocumentBuilder();
                   Document document = builder.newDocument();
                   Element beeE = document.createElement("BeeSets");
                   Element grpE = document.createElement("Group");          
                   bioE.appendChild( grpE );
                   // the document looks like "<BeeSets><Group></Group><BeeSets>";
                   // After inserting the Node DetailNode, I want it to look like
                   // "<BeeSets><Group><Detail><Msg>Detail Message</Msg></Detail></Group><BeeSets>";
    Now when I tried to insert the node DetailNode to the DOM document, I tried
    1) document.importNode( DetailNode, true );               
    No exception was thrown. But when I transformed the DOM document back to a String, I could not see the information from the newly imported Node DetailNode.
    When I tried
              grpE.insertBefore( BiometricDetailNode, dataE );
    I got the following exception.
         org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it.
         at org.apache.xerces.dom.ParentNode.internalInsertBefore(Unknown Source)
         at org.apache.xerces.dom.ParentNode.insertBefore(Unknown Source)
         at com.jadcs.bioidentity.role.base.RP.getNodes(RP.java:497)
    2) document.adoptNode( DetailNode );
    I got the following exception.
         java.lang.ClassCastException: org.apache.xerces.dom.DocumentImpl
         at org.apache.xerces.dom.DeferredTextImpl.synchronizeData(Unknown Source)
         at org.apache.xerces.dom.NodeImpl.setOwnerDocument(Unknown Source)
         at org.apache.xerces.dom.ParentNode.setOwnerDocument(Unknown Source)
         at org.apache.xerces.dom.ElementImpl.setOwnerDocument(Unknown Source)
         at org.apache.xerces.dom.ParentNode.setOwnerDocument(Unknown Source)
         at org.apache.xerces.dom.ElementImpl.setOwnerDocument(Unknown Source)
         at org.apache.xerces.dom.CoreDocumentImpl.adoptNode(Unknown Source)
         at com.jadcs.bioidentity.role.base.RP.getNodes(RP.java:509)
    3) detailStr = "<Detail><Msg>Detail Message</Msg></Detail>";
    Element detailE = document.createElement("Detail");
    detailE.setTextContent( detailStr );
    grpE.appendChild( detailE );
    This way gives result like "<BeeSets><Group><Detail><Detail><Flash>On</Flash></Detail></Detail></Group><BeeSets>";
    The content is messed up.
    Could someone help me out at how to insert a Node properly into a DOM? Thank you very much.

    Said another way, importNode actually only makes and returns a copy of the node you gave it (it will be a deep copy only if you pased true as the second parameter), but where the new dom you called import on is owner.
    So what you need to do is more like this:
    Node tempNode = domYouAreAddingTheNodeTo.importNode(node2copy,true); //true if you want a deep copy
    domYouAreAddingTheNodeTo.appendNode(tempNode);You can also traverse to any point in the DOM and insert the node there with the same method, but you always have to import first so that the DOM has a copy of the node that it owns.

Maybe you are looking for

  • Mail in fullscreen - open two or more messages

    Hi In Mail, full screen view, I want to have two or three messages open at once, for instance to copy and paste from one to the other. It seems I can't. Just one message can be open. If that's my draft, I have to save it to drafts, close it, then ope

  • Using xmltype in JDeveloper 10.1.3.3

    Hi ! I have a table that has one of the columns defined as xmltype datatype. I am trying to use ADF to create a simple form that the end users can use to view/edit this xml data. I get some garbage data like this ... in this field when displayed ...

  • JCAP512 and JCAP6 conflict with concurrent database connectivity

    So here is the situation: Environment: - We have a production JCAP6 appserver (AIX server 1) running a project pulling data from database A - We have 4 JCAP512 domains on AIX Servers 2,3,4 running 4 distinct projects pulling data from server A - All

  • Security product standard guidelines

    Hi Can some one help me out in giving the information about maintaining the security product standard in web dynpro java applications. Regards Sudheer varma

  • Time Capsule --- Airport extreme ---- 2 airport express en wds

    Hi, I created a wds network for my house. I set the timecapsule as the main base and set the aiport extreme and two airport express as remote. My problem is that everything is working well except for the second airport express. I checked everything a