Subject Re: Major stumbling block: Lack of multiple-row insert capability
Author Milan Babuskov
--- In firebird-support@yahoogroups.com, "jft" <jft@...> wrote:
> I put the example code from this thread into
> the following script & ran it from iSQL in
> a database created under FB2 (ver 2.0.0.12748):
>
> RECREATE TABLE TABLE1 (
> col1 integer,
> col2 integer);
> COMMIT;
> EXECUTE BLOCK AS BEGIN
> INSERT INTO TABLE1(col1,col2) VALUES(1,2);
> INSERT INTO TABLE1(col1,col2) VALUES(3,4);
> END;
>
> The output was:
> SQL> RECREATE TABLE TABLE1 (
> CON> col1 integer,
> CON> col2 integer);
> SQL> COMMIT;
> SQL> EXECUTE BLOCK AS BEGIN
> CON> INSERT INTO TABLE1(col1,col2) VALUES(1,2);
> Statement failed, SQLCODE = -104
> Dynamic SQL Error
> -SQL error code = -104
> -Unexpected end of command - line 2, column 42

You need to change the terminator as isql stops parsing at first
semicolon (;). Do it like this:

RECREATE TABLE TABLE1 (
col1 integer,
col2 integer);
COMMIT;
SET TERM !! ;
EXECUTE BLOCK AS BEGIN
INSERT INTO TABLE1(col1,col2) VALUES(1,2);
INSERT INTO TABLE1(col1,col2) VALUES(3,4);
END!!

At the end, you probably want to turn terminator back to semicolon:

SET TERM ; !!

--

Milan Babuskov
http://www.guacosoft.com