BASE SQL Box TOOLS/SQL Dialog Box

Discuss the database features
Post Reply
Craig209Smith
Posts: 12
Joined: Thu Nov 15, 2018 1:17 pm

BASE SQL Box TOOLS/SQL Dialog Box

Post by Craig209Smith »

When I execute the following code. I get an error. I have tried counter, 'counter', and "counter" all with the same results. What dumb thing am I doing wrong?

DECLARE counter BIGINT;
counter = 1;
UPDATE "tbAll_Game_Word"
SET "fRand" = RAND(),
"fCount" = counter,
counter = counter + 1
WHERE "fLen" = 2;

1. Unexpected token: DECLARE in statement [DECLARE]
OpenOffice 4.1.2 on Windows 10
Mountaineer
Posts: 316
Joined: Sun Sep 06, 2020 8:27 am

Re: BASE SQL Box TOOLS/SQL Dialog Box

Post by Mountaineer »

Imho you didn't read the error message.
Either Base or your Database can't handle the Keyword declare.

If your Database can: There is a Button SQL at the Toolbox,wich prevents Interpretation of your Command by Base and sends it directly to the used Database

J.

correction: Villeroy is right (below), the direkt-SQL button is only for a query not in the toolbox.
Last edited by Mountaineer on Sat Oct 31, 2020 4:26 pm, edited 2 times in total.
OpenOffice 3.1 on Windows Vista
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: BASE SQL Box TOOLS/SQL Dialog Box

Post by Villeroy »

It is the database engine. Base does not parse commands entered into the SQL box. The type of engine is indicated on the left side of the status bar.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply