Ask Your Question
0

INSERT INTO not working

asked 2020-06-11 14:16:09 +0200

TrevJ gravatar image

updated 2020-06-11 14:21:49 +0200

Why do I get :- Unexpected token ., requires FROM in statement [INSERT INTO "WordSubject"("WordsID","SubjectID") (SELECT "WordsTable" .]

Full statement is :- INSERT INTO "WordSubject"("WordsID","SubjectID") (SELECT "WordsTable" . "ID" AS "WordsID", "SubjectTable"."ID" AS "SubjectID" FROM "WordsTable","SubjectTable" WHERE "WordsTable"."Subject" LIKE '%country%' AND "SubjectTable"."ID" ='1')

WordSubject is a 2 field table containing "WordsID","SubjectID" that already exists.

The select statement works fine on it's own.

This is executed in the Tools>SQL dialogue.

I am using Libre Office Version: 6.0.7.3 in Linux Mint 19.1 with HSQLDB.

Thanks

edit retag flag offensive close merge delete

Comments

Brilliant, Thank you. Don't always see the obvious!

TrevJ gravatar imageTrevJ ( 2020-06-11 22:41:55 +0200 )edit

@TrevJ: Please mark the answer as correct. See guidelines for asking.

Jim K gravatar imageJim K ( 2020-06-11 23:03:49 +0200 )edit

@TrevJ

Not the proper place to respond to my answer. You are actually responding to the posted question. Only saw this because of upvote (Thanks most likely to @Jim K ).

Responses should be under the answer you are responding to so a notification is giver to the person responding to. Otherwise that person may never see important information.

Ratslinger gravatar imageRatslinger ( 2020-06-11 23:37:28 +0200 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2020-06-11 20:25:41 +0200

Ratslinger gravatar image

Hello,

You have extra spaces at:

 "WordsTable" . "ID"

Removing the spaces so it is:

 "WordsTable"."ID"

worked in my testing.

edit flag offensive delete link more

Comments

OK , Noted. Thanks

TrevJ gravatar imageTrevJ ( 2020-06-12 11:41:40 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-06-11 14:16:09 +0200

Seen: 41 times

Last updated: Jun 11