Using SQLite from Objective-C -
I am having trouble writing a statement, especially when updating.
- I have columns with one parameter, but I do not know special characters like
@
or% d
.
I did try:
const char * sqlStatement = [[NSString stringWithFormat: @ "Update lugar set frecuencia = 'd%' aumentador where idlugar = '% D' ", idlugarParametro] cStringUsingEncoding: NSUTF8StringEncoding];
But I have a problem with: frecuencia = 'd%' aumentador
- How can I find a guide or tutorial? Am I to use this special character for creation statement? (Use specially aimed.)
Here it is.
Here for Apple documentation, and more.
I think that looks like you typed d%
, but possibly for an additional specification of % d
for the format specifier Is required), and you have only supplied one arg (idlugger paramitro), but there are two specifiers in your format string:
---------- --- ----------------- 1V ----------------------------- -2v update Lugar set Frequania = '% d' aumentador where idlugar = '% d'
so that you supplied two values Need - New Frequency value is not there.
Finally, suggest that after the basics are hanged, you should consider using the prepared statement - see SQLite Docs.
Comments
Post a Comment