I don't think you can pass a column name as a parameter. If I execute
the same query using Database Workbench I also get "Dynamic SQL Error
SQL error code = -804 Data type unknown" error so it must be
limitation of firebird database.
It would in any case not be any faster since I don't think the
database can prepare and reuse the query where the columns change.
On Thu, Aug 26, 2010 at 12:04 PM, Matej Golob <matej@...> wrote:
> I have problem when I use parameters and compare parameter value with null.
> I've create simple snipet code, which represents problem:
>
>
>
> FbCommand com = connection.CreateCommand;
> com.CommandText = "SELECT * from rdb$database where @n0 is null";;
> FbParameter par = new FbParameter("n0", FbDbType.VarChar);
> par.Value = "a";
> com.Parameters.Add(par);
> var reader = com.ExecuteReader();
>
>
>
> No mather what value is, If I execute this I get error: Invalid data type.
>
> If I do »same« with literals (»SELECT * from rdb$database where 'a'
> is null«) of course everything works fine, so I assume there should be
> problem in provider.
>
>
>
> Thanks for help.
>
>
>
> Matej
>
> ------------------------------------------------------------------------------
> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
> Be part of this innovative community and reach millions of netbook users
> worldwide. Take advantage of special opportunities to increase revenue and
> speed time-to-market. Join now, and jumpstart your future.
> http://p.sf.net/sfu/intel-atom-d2d
> _______________________________________________
> Firebird-net-provider mailing list
> Firebird-net-provider@...
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
>
>
--
Gerdus van Zyl
|