LO Base SQL problems

My Query

DECLARE @var
SET @var = 10
SELECT @var

fails to execute. (All are on separate lines)

Also there is no syntax highlighting for DECLARE statement.

Exact syntax error:

syntax error, unexpected $end, expecting BETWEEN or IN or SQL_TOKEN_LIKE

What are you trying to achieve?

This was just a test query.My goal is to set an entry in one table with SUMed data from column in other table.I already have the SQL code,but the problem is that LO Base will not recognise the DECLARE statement.

You probably don’t need variables at all, just use subquery. But the error is about the select statement. In the select statement you also need to specify the table you are selecting from, e.g SELECT * FROM “MyTable”;
But setting the column using variable didn’t work (but this is not what you need).

@DOYOUNEEDTOKNOW – Did @mahfiaz’s Answer help solve your question? Are you still interested in finding an answer to this question?