Re: [Firebird-net-provider] problem with a query (maybe a bug)

2010-05-01 Thread Mercea Paul
On 2010.04.29 5:06 PM, André Knappstein, Controlling wrote:
 k  select userinfo0_.id as x0_0_
 k  from user_infos userinfo0_
 k  where (@p0 in(select views1_.View_Id from User_Views_Map views1_
 k  where userinfo0_.id=views1_.User_Id))

try this

select userinfo0_.id as x0_0_
from user_infos userinfo0_
where exists (select 1 from User_Views_Map views1_
where userinfo0_.id=views1_.User_Id and views1_.view_...@p0)

Regards
Paul



--
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] problem with a query (maybe a bug)

2010-04-29 Thread André Knappstein , Controlling

k select userinfo0_.id as x0_0_ 
k from user_infos userinfo0_ 
k where (@p0 in(select views1_.View_Id from User_Views_Map views1_
k where userinfo0_.id=views1_.User_Id))


I have such an idea, that you cannot use a dynamic parameter at this
place. But I can be wrong.

k note 2: if i do the query directly to firebird all is ok so the
k problem is with the .net data provider


How do you do the query directly to firebird ?

---

--
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] problem with a query (maybe a bug)

2010-04-29 Thread korkless
How do you do the query directly to firebird ?

i did the query 
using directly the parameter value (as integer and string) :)

it's this query cannot by done with the parameter in this place can samebody 
help me to rebuilt it?



  

--
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] problem with a query (maybe a bug)

2010-04-29 Thread Jiri Cincura
On Thu, Apr 29, 2010 at 15:30, korkless korkl...@yahoo.it wrote:
 it's a bug or i'm doing samething wrong?

You can't use a parameter there, as server isn't able to infer the
type. Easiest way is to do there a cast.

-- 
Jiri {x2} Cincura (CTO x2develop.com)
http://blog.cincura.net/ | http://www.ID3renamer.com

--
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] problem with a query (maybe a bug)

2010-04-29 Thread Gerdus van Zyl
Any reason why you are not doing it simpler like this:

to get list of user id's for specific view
SELECT
  USER_VIEWS_MAP.USER_ID
FROM
  USER_VIEWS_MAP
WHERE
  USER_VIEWS_MAP.VIEW_ID = @viewid

and something like this get the user table:
SELECT
  USER_INFOS.*
FROM
  USER_INFOS
  INNER JOIN USER_VIEWS_MAP ON USER_VIEWS_MAP.USER_ID = USER_INFOS.ID
WHERE
  USER_VIEWS_MAP.VIEW_ID = @viewid

Joins are normally much faster than IN SELECT because of better index use.

~Gerdus

On Thu, Apr 29, 2010 at 4:36 PM, Jiri Cincura disk...@cincura.net wrote:
 On Thu, Apr 29, 2010 at 15:30, korkless korkl...@yahoo.it wrote:
 it's a bug or i'm doing samething wrong?

 You can't use a parameter there, as server isn't able to infer the
 type. Easiest way is to do there a cast.

 --
 Jiri {x2} Cincura (CTO x2develop.com)
 http://blog.cincura.net/ | http://www.ID3renamer.com

 --
 ___
 Firebird-net-provider mailing list
 Firebird-net-provider@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


--
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] problem with a query (maybe a bug)

2010-04-29 Thread korkless
thanks all, i resolved reweiting the query in another way,

i was using this query becouse it's autogenerate with nhibernate



  

--
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider