开发者

How pass a parameter to IN Operator?

I'm Trying, pass a long array for a named query (native SQL) for to use in an IN STATEMENT: Like this:

(...) WHERE Identificator IN (:pIdes)

I tried pass my ides as long[]:

 ctx.GetNamedQuery("NamedQueryName")                                          
                   .SetParameter<long[]>("pIdes", Identificators)
                   .List<EmpreendimentoInputReport>();

and as a string

 ctx.GetNamedQuery("NamedQueryName")                                          
                  开发者_Go百科 .SetParameter<string>("pIdes", Identificators)
                   .List<EmpreendimentoInputReport>();

When the parameter is a string return nothing, whem is a long[] return this Oracle error:

"Oracle.DataAccess.Client.OracleException: ORA-00932: tipos de dados inconsistentes: esperava NUMBER obteve BINARY"


Use SetParameterList instead of SetParameter.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜