Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Delete Query not working

Delete Query not working

Scheduled Pinned Locked Moved Database
databaseasp-netsqlitegame-devhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    T RATHA KRISHNAN
    wrote on last edited by
    #1

    Hi! I'm using SQLite for my game. When a particular button is clicked,I've to get the selection of a list control and delete it from the list control and from the database. for this I'm using the following code and query.

    if(m_pSelectProfileImage->getRelativePosition().isPointInside(m_MousePos))
    {
    stringw strtoDelete = profileList->getListItem(profileList->getSelected());
    strtoDelete.make_lower();
    strtoDelete.trim();
    if(!strtoDelete.equals_ignore_case(L"default"))
    {
    irr::core::stringc testStr = "DELETE FROM profile WHERE name = '";
    testStr += strtoDelete;
    testStr += "'";
    pManager->SQLdb.Query(testStr);
    profileList->removeItem(item);
    }
    }

    I execute the above line and open the database file using SQLite Database Browser to check whether the particular record has been deleted. It's not deleted. When I put a break point to verify the query, my list selection is there in the query(testStr). What might be the problem? How to delete a record?

    G 1 Reply Last reply
    0
    • T T RATHA KRISHNAN

      Hi! I'm using SQLite for my game. When a particular button is clicked,I've to get the selection of a list control and delete it from the list control and from the database. for this I'm using the following code and query.

      if(m_pSelectProfileImage->getRelativePosition().isPointInside(m_MousePos))
      {
      stringw strtoDelete = profileList->getListItem(profileList->getSelected());
      strtoDelete.make_lower();
      strtoDelete.trim();
      if(!strtoDelete.equals_ignore_case(L"default"))
      {
      irr::core::stringc testStr = "DELETE FROM profile WHERE name = '";
      testStr += strtoDelete;
      testStr += "'";
      pManager->SQLdb.Query(testStr);
      profileList->removeItem(item);
      }
      }

      I execute the above line and open the database file using SQLite Database Browser to check whether the particular record has been deleted. It's not deleted. When I put a break point to verify the query, my list selection is there in the query(testStr). What might be the problem? How to delete a record?

      G Offline
      G Offline
      Gerben Jongerius
      wrote on last edited by
      #2

      Since your SQL query seems to be OK it could be one of two things. It could be that you conversion from strinw to stringc is doing something with the query (eg you are getting strange characters in your query because of conversion issues). A second potential cause could be that the pManager->SQLdb.Query function doesn't actually execute the query but just prepares the internal object for execution (but I can't say this for sure as I have no idea what the buildup of that class is). There is also a note in SQLite that case insensative unicode matching doesn't work see point 18. I hope this helps you a bit along.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups