Subject RE: [firebird-support] Re: Major stumbling block: Lack of multiple-row insert capability
Author Nigel Weeks
I believe 'execute block' is for use inside a stored procedure or trigger -
not for use by isql directly.

N.

-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com]On Behalf Of jft
Sent: Wednesday, 24 January 2007 4:39 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Re: Major stumbling block: Lack of
multiple-row insert capability


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
SQL> INSERT INTO TABLE1(col1,col2) VALUES(3,4);
Records affected: 1
SQL> END;
Statement failed, SQLCODE = -104
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 1
-END
SQL>

Am I missing something here?
Thanks,
John

> -------Original Message-------
> From: Ivan Prenosil <Ivan.Prenosil@...>
> Subject: Re: [firebird-support] Re: Major stumbling block: Lack of
multiple-row insert capability
> Sent: 24 Jan '07 03:27
>
> > Are you saying that I can send as one string: "EXECUTE BLOCK AS BEGIN
> > INSERT INTO TABLE1(col1,col2) VALUES(1,2); INSERT INTO
> > TABLE1(col1,col2) VALUES(3,4); END" and it will work?
>
> Yes. You are limited by the max length of sql statement (i think 64k).
<munch, munch>
> Ivan





[Non-text portions of this message have been removed]