0

I am converting a 'SQL Server 2008' stored procedure to 'SQLite'. But facing problem with the following query:

If (Select Count(UserId) From Users Where RememberMe = 'True') > 1
Update Users Set RememberMe = 'False'
Select UserName From Users Where RememberMe = 'True'

While executing the above query in the 'SQLite Administrator' or 'SQLite Expert', I am getting the following error message:

Error occured: near "If": syntax error

I am a beginner in SQLite. Please guide me.

Thanks & Regards,

2 Answers 2

2

Sqlite does not support if. You can use CASE instead of it.

Sign up to request clarification or add additional context in comments.

Comments

0

SQLite doesn't support stored procedures.

But it looks like your code only updates the Users table to set RememberMe = 'False' for users that had it set to 'True'. If this is the case, then you don't need to do the If part at all. This should suffice:

UPDATE Users SET RememberMe = 'False' WHERE RememberMe = 'True';

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.