INSERT INTO in IB Expert

562 views Asked by At

I have thousands of lines that look like this:

insert into TABLE (name) values ('name_1');
insert into TABLE (name) values ('name_2');
...
insert into TABLE (name) values ('name_10000');

Executing them one by one works just fine. But when I want to run two or more at once it will always return error at 2nd line:

Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 2, column 1.
insert.

Any clues how to fix it? Removing ; changes nothing.

2

There are 2 answers

1
James On

The syntax for EXECUTE BLOCK should be something like this:

execute block
as
begin
  insert into TABLE (name) values ('name_1');
  insert into TABLE (name) values ('name_2');
  ...
  insert into TABLE (name) values ('name_10000');
end
4
user13964273 On

Execution of several SQL commands at once must be done not in the "SQL Editor" but in the "Script Executive" (Ctrl-F12 instead of F12).