Ask Your Question
0

BASE firebird - Error inserting multiple rows into a column

asked 2019-11-07 10:01:38 +0100

Vishi gravatar image

updated 2019-11-07 10:03:01 +0100

Hi there,

I run into a problem trying to insert multiple rows into a table column:

This works:

INSERT INTO "water_extract" ("ID", "sample_id") VALUES (3, 1002)

This does not:

INSERT INTO "water_extract" ("ID", "sample_id") VALUES (3, 1002), (4, 1003)

This is the error I get:

1: firebird_sdbc error: *Dynamic SQL Error *SQL error code = -104 *Token unknown - line 2, column 17 *, caused by 'isc_dsql_prepare'

Any help would be appreciated,

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-11-07 18:53:48 +0100

Ratslinger gravatar image

Hello,

Whenever you may have a problem with SQL for a database, it is best to refer to the documentation. Firebird documentation is found here -> Firebird 2.5 Language Reference (English). This is the latest version.

Also note this Firebird page -> How to insert multiple rows in a single statement?.

Using my own table this works without a problem.

So your statement should be:

INSERT INTO "water_extract" ("ID", "sample_id")
SELECT 3, 1002 FROM RDB$DATABASE UNION ALL
SELECT 4, 1003 FROM RDB$DATABASE;
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-11-07 10:01:38 +0100

Seen: 32 times

Last updated: Nov 07