Subject | Re: [firebird-support] Error message from an invalid SQL Query |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2006-12-05T12:10:35Z |
Michael Vilhelmsen wrote:
column list and variable list do not match), I find this error message
descriptive enough. Let's look at the SQL:
similar)
then you do
above. That's impossible, hence 'count of column list and variable list
do not match'. Mind you, I certainly wouldn't object if it was changed
to something like 'incorrect number of columns specified' or similar,
but I'm generally not all too unhappy with this error message.
Though, of course IBO ought to be improved in cases like this (I've
never tried counting a UNION, and kind of doubt that it is feasible, so
the improvement could be to simply refuse to do the count).
Set
> HiExcepting that I would want a comma (Invalid command, count of
>
> I just had a strange problem with a query, which I got solved with
> some help from Martijn Tonies.
>
> I got an error message in my appl. and couldn't quite figure it out.
> Whatever I googled said something about stored procedures ....
>
> The SQL that was about to be executed was:
>
> select
> Count(*)
> from ekspedienter
> where
> Ekspedienter.afdeling_ID=:PAfdeling_ID and ekspedienter.nr=99999
>
> Union
>
> Select
> nr,
> navn
> from EkspedienterTilSalg Where
> Afdeling_ID=:PAfdeling_ID and
> UAfd_Navn=:PUAfd_Navn
>
> Its not something I generated, but rather IBO doing it internally
> (When doing a MyQuery.RecordCount).
>
> The error that comes up is this:
>
> ISC ERROR CODE : 335544569
> Dynamic SQL Error SQL error code = -104 Invalid command count of
> column list and variable list do not match
>
> In my point of view this error message is a bit wierd.
>
> I ran this query on a FB 1.5.3 and Fb 2.0
>
> Regards
> Michael
column list and variable list do not match), I find this error message
descriptive enough. Let's look at the SQL:
>selectThis says that the query should return one column of type integer (or
> Count(*)
>from ...
similar)
then you do
> Unionthis is two columns that have to be put into the one integer column
>
> Select
> nr,
> navn
> from ...
above. That's impossible, hence 'count of column list and variable list
do not match'. Mind you, I certainly wouldn't object if it was changed
to something like 'incorrect number of columns specified' or similar,
but I'm generally not all too unhappy with this error message.
Though, of course IBO ought to be improved in cases like this (I've
never tried counting a UNION, and kind of doubt that it is feasible, so
the improvement could be to simply refuse to do the count).
Set