To start, I am not an SQLite user. i haven't used a database for
   many years and have never used an SQL database.

   I am on a MS Windows system. I have an application that uses SQLite as a
   database for storing its information.

   The name of the file containing the database is "a.sqlite". The database
   contains a single table called "m".

   The application uses SQLite Manager to manage the database.

   When I open Manager, it opens the database file. I can see the table
   entries1

   For each entry (row) in the database there are columns. The two
   columns of interest are "Subject" - a string - and "Value" - an
   integer.

   Ex: id      Subject            Value  ... Other columns

       7     Example C current      9
       8     Example A last         1

   I can hand-edit the values in the columns using the window
   interface, but this is slow and onerous.
   
   There is a tab in the Manager window called "Execute SQL", which I
   assume will take SQL commands and execute them against the opened
   table.

   I have some 2000 entries in the table. I would like to change all of the
   values of the "Value" column to a specific integer based on the content
   of the "Subject" column.

   Thus, if the "Subject" column does not contain the string "last", I
   want to replace the "Value" with an integer, say "5".

   Also, if the "Subject" column contains the string "current", I want
   to replace the "Value" witn an integer, say "3".

   So, I need to "Select" and "Replace" the entries conditionally.

   I am sure there are a very small number of commands I need to complete
   this change for all 2000 rows, but I don't know what they are and
   wouldn't know the specific syntax needed. I haven't found help in the
   "Doucments" provided on the SQLite site.

   If I had the commands, I would enter these commands using the "Execute
   SQL" box.

   I will only need to do this once, which is why I am asking for help. If
   I needed to manipulate SQLlite databases as part of my work, I would
   take the time to learn SQL commands and syntax.

   Can someone send me the exact commands I need to finish the task?

   (The application developer says they aren't responsible for telling
   thier users how to use SQL Manager. :-( )

   Of course, I will try the commands on a copy of the file before
   changing the real file.

   Please e-mail the answer to: don_u_w...@yahoo.com
   as I am not a member of this mailing list.

   TIA

   Don Wish

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to