Click here to Skip to main content
15,899,314 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
There is a reference database:
references.db
Its one of the tables contain fields:
NAME(char) C(decimal number)

Data containing databases with identical structure:
a....x.db
b....y.db
c....z.db
.
.

Their one of the tables contain fields:
NAME1(char) NAME2(char) A(integer)

I want to reference and compare C values of NAME1 and NAME2 in every record of the data files, then if C1 > C2, change the value of A by a fixed amount. In which program can I do this operation? Don't have SQLite installed, would prefer a light weight utility that could support the function.

What I have tried:

I tried exploring in sql studio and opening in notepad++ but couldn't think of a way to do it. It has been a while since I last touched sql so would prefer a simple solution.
Posted
Updated 28-Dec-17 22:02pm

1 solution

If it is an SQLite database you can use the SQL command line program sqlite3. See Command Line Shell For SQLite[^].
 
Share this answer
 
Comments
Member 13598556 30-Dec-17 2:07am    
Thanks, could you give some outline on how I can go about doing above with the utility.
Richard MacCutchan 30-Dec-17 3:22am    
Not really, a I don't know what you need. But since the documentation is already written that is the best place to start.
Member 13598556 2-Jan-18 12:05pm    
After spending some time on the sqlite3 utility, I am able to make selection between the tables referencetable and datatable, and output C1 and C2 values separately but it hasn't come of much use in my above objective. Right now I am trying to make selection:
select A from datatable where (here I want to fetch C values corresponding to NAME1 and NAME2 of the current read record, from the referencetable then make a comparison). Using the select command outputs matches for the whole table so I am unable to use it in the brackets, which command can I use to call only the value for the current read record? Eventually I want to update A=A+100 when meeting a condition between C1 and C2.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900