On 17/05/2009 1:35 AM, velkropie wrote: > Hello, > > I'm trying to update two tables with one statement but, i'm not getting > something right. can someone here help me , or guide me to the right place > to get help? > > Thanks > > "UPDATE funrecipes, ingredients SET funrecipes.recipetitle, > funrecipes.copyright, funrecipes.directions, ingredients.ingredient_name > WHERE ingredients.pk = funrecipes.pk" > > this is returning a database error, any ideas?
A "database error"? Nothing to do with a database, it's just not valid SQL. Read this: http://www.sqlite.org/lang_update.html There are _*TWO*_ syntax problems with your UPDATE statement: (1) it is not possible to update more than one table in the same UPDATE statement (2) you don't say *what* each column must be set to ... the syntax is SET column_name1 = expression1, column_name2 = expression2, ... And possibly one logic problem ... your WHERE clause would look a bit suss even in a SELECT statement, especially if "pk" means "primary key". HTH, John _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users