×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    88

    How to update data in the table

    Hi

    I want to update the message which already in the database.

    I am able to get the selected masage to the TextEditior, but when i give update it is updating in the 0th positon only not in the selected message index value. Please give me the solution and my code for update is




    Idx = this->iTemplateContainer->GetValueL();
    MsgId.AppendNum(Idx);

    _LIT(KSelect,"SELECT * FROM Template");
    _LIT(KWhere, " WHERE MsgId ");
    _LIT(KEqual, " = '");
    _LIT(KOrderBy, "'ORDER BY MsgId ");

    delQuery.Copy(KSelect);
    delQuery.Append(KWhere);
    delQuery.Append(KEqual);
    delQuery.Append(MsgId);
    delQuery.Append(KOrderBy);

    newText = this->iMessageContainer->GetText();
    this->view1->Prepare((*(this->database)),TDbQuery(delQuery),RDbView::EUpdatable);
    this->view->EvaluateAll();
    //this->view->FirstL();

    for (this->view->FirstL();this->view->AtRow();this->view->NextL())
    {
    if(this->view->AtRow())
    {
    this->view->GetL();
    this->view->UpdateL();
    msg.Copy(newText->Des());
    this->view->SetColL(1,MsgId);
    this->view->SetColL(2,msg);
    this->view->PutL();
    }
    this->database->Commit();


    REgards
    Deepa

  2. #2
    Nokia Developer Expert
    Join Date
    Jun 2007
    Location
    Moscow, Russia
    Posts
    1,355

    Re: How to update data in the table

    Hm, '
    this->view1->Prepare((*(this->database)),TDbQuery(delQuery),RDbView::EUpdatable);
    this->view->EvaluateAll();

Similar Threads

  1. Replies: 9
    Last Post: 2010-06-10, 12:39
  2. how to get binary column data from the table?
    By Tanya in forum Symbian User Interface
    Replies: 6
    Last Post: 2007-05-21, 13:04
  3. Settings List data update problem
    By gs_cmans in forum Symbian User Interface
    Replies: 3
    Last Post: 2006-02-13, 20:40
  4. Problems with client/server data transfer
    By wilse in forum Symbian
    Replies: 1
    Last Post: 2004-08-03, 16:14

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×