views:

146

answers:

2

HI,

I'm Trying, pass a long array for a named query (native sql) for to use in a 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")                                          
                   .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"

Someone can help me?

+1  A: 

Use SetParameterList instead of SetParameter.

Diego Mijelshon
A: 

Thanks, it works fine!

\o/

Flavio
Use the "add comment" link for responses instead of "Add Another Answer"
Diego Mijelshon