NSString containing sql query in objective-c -


i have sql query looks -

nsstring *createsql = @"select ingredients, recipe drinktable title '%_drinkname%'"; 

also _drinkname variable. correct syntax of writing in objective-c ?

assuming _drinkname nsstring, try:

nsstring *createsql = [nsstring stringwithformat:@"select ingredients, recipe drinktable title '%%%@%%'", _drinkname]; 

(note each of %'s needs doubled. , %@ string format parameter.)


Comments

Popular posts from this blog

Glib GIOChannel -

jsp - java.sql.SQLException: [Microsoft][ODBC Microsoft Access > Driver] Too few parameters. Expected 1 -

python - Obscure curses error message when creating a sub window -