Subject Re: [firebird-support] Re: Major stumbling block: Lack of multiple-row insert capability
Author jft
Milan,
Lovely! Works atreat!
First saw this in the FB2 release notes, but couldn't get it to work.
Its a very powerful enhancement to have procedural processing avaiilable in DSQL.
Thanks,
John
> -------Original Message-------
> From: Milan Babuskov <milanb@...>
> Subject: [firebird-support] Re: Major stumbling block: Lack of multiple-row insert capability
> Sent: 24 Jan '07 17:23
>
> --- In [LINK: mailto:firebird-support%40yahoogroups.com]
> 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
> [LINK: http://www.guacosoft.com] http://www.guacosoft.com
>
>