AFAIK this is a Firebird restriction.

 

I have quite a few like this and I ended up adding the list in code like:

 

String.Format(“Select * from Users where user_id in ({0})”, “4,6,93”).

 

If you have a known number of variables in your list you can do:

 

Select * from Users where user_id in (@v1, @v2, @v3)

 

Rick

 

From: Zoltán Török [mailto:toro...@gmail.com] 
Sent: Monday, March 22, 2010 7:04 AM
To: firebird-net-provider@lists.sourceforge.net
Subject: [Firebird-net-provider] Generic list as named parameter

 

Hi,

I have an SQL like this

SELECT * FROM users WHERE user_id in ( 4, 6, 93 )

I set the FbCommand's CommandText to
SELECT * FROM users WHERE user_id in @1

then added a List<long> to the named parameters

_IdList = new List<long>( new long[] {4, 6, 93});
_Command.Parameters.Add( new FbParameter( "@1", _IdList ) );

_Command.Prepare() and I get an exception

"Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 1, column 38.
?"


Is it possible to use generic lists as FbParameter ?


zolee

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to