Impossible database error

I’m getting this error using an SQLite database:

near “WHERE”: syntax error

sqlStatement:

UPDATE userScores SET week1dFXscore = 3, week1dPHscore = 6, . . . week1eHBscore = 0 WHERE teamName = ‘100+ Years of Killing Dreams’

This error is making no sense. userScores is a valid table.

Any suggestions?

I “assume” that the “…” is more of the comma delimited list of fields to be updated???
Please post the ENTIRE SQL statement

And the error is not “Impossible”… it is just not obvious to you… yet… but SQLite probably has a really good reason, and I bet when we figure it out… you will utter a “Doh!” :slight_smile:

And you can try simplifying

does this work?

UPDATE userScores SET week1dFXscore = 3  WHERE teamName = '100+ Years of Killing Dreams'

Yes:… there is a typo in the list of fields you didn’t show us
No… the teamName isn’t the one you are showing us here.

As Dave says, if you post something which is not the actual code you are using, no-one can help.

Jeff . . . Don’t bother to reply.

Hmm =\ that’s a good way of alienating people on the forum.

It might be that your code is creating a string with a + in which is a string concatenation character so you’ll need to use \+

As the error is coming from a javascript alert I’m assuming that you’re creating the query as javascript, if this isn’t the case then strip the query down into smaller parts as Jeff suggests and try each part until you find the problem but my first guess would be to try it on a teamName that doesn’t contain a + and see if it works.

Are you sure there is a space between “0” and “Where”?

Max . . . Yes I checked that

Julian . . . you’re clearly just guessing and feeling superior . . . have fun

lol, yeah, have fun with your error too

vague information = vague answers

have fun :slight_smile:

made me laugh anyway, thanks for the sunday chuckle

I’d look at that error or the query as hex in the debugger and make sure there are no invisible characters right there.

Well, any advice would be a guess. What is no guess is that someone here is being an arrogant prlck. I leave it to you to figure out who that might be …

Looks like junior needs a time out.

Mr.Scanlan… please be advised that this is a VOLUNTEER effort… .and to be honest… .your recent responses make it unlikely that I will be bothering to look any further into your issue… to quote you… "Have Fun

John

At the risk of being berated, have you tried the same SQL statement without the WHERE clause? I’ve honestly been in these situations and always find that the error was leading me in the right direction, but I just wasn’t looking at it close enough.

If it works without the where clause, I’d try to substitute a different WHERE clause and see if that works.

What I’m leading to is verifying that “teamName” is relative to the table you’re trying to do the update in. I’d be curious to know the answer when you finally uncover it.

I feel your frustration, but we are only trying to look at the obvious with limited information.

I apologize those who want to help, but aren’t we all tired of responses that basically say the person asking a question is dumb?

John F: Good idea, but this is an UPDATE statement. It needs the WHERE clause. Thanks,

Greg: How do I check a statement in HEX? I can’t find that in the user guide.

Have you tried JulianS’s suggestion to escape the plus sign? That’s first caught my eye.

Regarding an UPDATE without a WHERE, you can just make a copy of the database and perform the query there without an UPDATE clause. It will, of course, update all records in the database, but at least you can see if the problem is isolated to your WHERE clause. Most SQLite managers like Tadpole let you perform queries in a dedicated window.

Nobody called you “dumb”… or even said anything that would infer that.

Ralph… :slight_smile: Thanks for mentioning Tadpole…

First thing I would do is try the same statement a select if you want to validate the where clause. I think you’ll find the problem with the plus as others already mentioned.

This statement created the same error: sqlStatement = “UPDATE userScores SET week1dFXscore = 3 WHERE teamName = ‘Chalk Talk’”