TriumphRacer wrote:Paul, first, let me thank you again for wonderful program. Your example program, TEST.BAS, was SOOOOO helpful. Made so many things much, much easier.
Awesome! Really happy it helped you. :-)
One question though. In TEST.BAS
In the "CREATE A TABLE" section, you clearly designate salary as a REAL. However in the "INSERT SOME DATA" section, you convert it to a STR. Does this mean that when I want to use it, I'll have to convert it back to a REAL using a VAL( ) statement?
I used STR because I need to convert the value to a STRING in order to concatenate it to the rest of the SQL query string that I was constructing to send to the sqlite engine. You can see that I did not use a single quote ' character around that string so when the SQL query is executed by sqlite it will attempt to store it as a numeric/REAL. Data types in sqlite are "weird" because you can store just about anything to the database without really having a fine regard to the actual data type. You can store strings as values, values as strings.... Sqlite has a concept known as column affinity which can be confusing when you come from database engines that have strict rules about storage values (that is, columns defined as numeric can only be given numbers, character fields only strings, etc... Errors are thrown otherwise).
When you retrieve data back from the database you may have to use VAL to convert the string to a numeric, although I think that I have methods built into the class that retrieve data as various numeric types.