Subject Re: [firebird-support] Multiple dynamic sql statements supported?
Author Matthew Adams
The exact FbException message that I get from the .NET provider after
removing the "set term ^ ;" and ending "^" is:

Dynamic SQL Error
SQL error code = -104
Unexpected end of command - line 144, column 168

Interestingly, I have way more than 144 lines in my command; I have 16113
lines, which equates to 16111 insert commands after you account for the two
lines "execute block as begin" and "end". Column 168 of line 144 is smack
dab in the middle of a datetime string. I figured that I'd verify that the
syntax was ok and that there must be some upper limit on the number of
characters allowed in a command, so I changed the code to include "execute
block as being", only one insert command ending with a semicolon, and
"end". That command worked, which confirmed that the syntax works via the
.NET provider, and that either the .NET provider or Firebird has a
limitation on the size of the textual SQL command.

If I knew what that size was, I could adjust the loop that produces the
inserts to issue the block if adding the next command would exceed the size
limit. I guess I'll start digging. Do you suppose the limitation is in the
.NET provider or in Firebird itself?

-matthew

On Fri, Jan 14, 2011 at 6:07 PM, Paul Vinkenoog <paul@...> wrote:

>
>
> Hello Matthew,
>
>
> > Execute block indeed no worky. My sql looked like this:
> >
> > set term ^ ;
> > execute block as begin
> > insert into ...;
> > insert into ...;
> > end ^
> >
> > The .NET provider threw an FbException with the following error message:
> >
> > Dynamic SQL Error
> > SQL error code = -104
> > Token unknown - line 1, column 5
> > term
> >
> > Any ideas?
>
> SET TERM is not SQL, but a client extension supported by e.g. isql and
> FlameRobin.
>
> The Firebird *server* doesn't recognize it, doesn't want it and gives the
> above error.
>
> But the server does accept this:
>
> execute block as
> begin
> insert into mytable values (2, 3);
> insert into mytable values (8, -15);
> insert into mytable values (0, 255);
> end
>
> Notice that there is no termination character after 'end'.
>
> Any client that passes the user input *unchanged* to the server can be used
> for this type of statement.
>
> I've never used the .NET provider, so I don't know about that. What is the
> exact error that you get if you pass the execute block statement without the
> SET TERM stuff (as you did the first time)?
>
> Paul Vinkenoog
>
>



--
mailto:matthew@...
skype:matthewadams12
yahoo:matthewadams
aol:matthewadams12
google-talk:matthewadams12@...<google-talk%3Amatthewadams12@...>
msn:matthew@... <msn%3Amatthew@...>
http://matthewadams.me
http://www.linkedin.com/in/matthewadams


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