I am trying to get a row and return a column from the fetched row, but somehow it is not working. I suspect my syntax is wrong.
I have declared an int variable ("Key") and populate its value from another table and want to use this to select the row.
Code:
NSInteger Key = [mydetailsTable.AgeNB integerValue];
My NSLog reports the correct value from the other table:
2010-05-20 17:56:03.941 Ifa[13992:207] Key: 48
If I hard code the value, then it gets the row and returns the correct Rate.
Code:
const char *sql = "SELECT Rate from PremiumRates WHERE AgeNB = 48"//works;
const char *sql = "SELECT Rate from PremiumRates WHERE AgeNB = Key";//does not work
If I use the int variable it does not find the row.
I have looked around, but there seem very few examples of the format of the WHERE clause when trying to return selected rows.
Anyone who can help me? Much appreciated!!!!