8

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")                                          
                   .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"

Dharman
  • 30,962
  • 25
  • 85
  • 135
Flavio
  • 135
  • 3
  • 7

1 Answers1

14

Use SetParameterList instead of SetParameter.

Diego Mijelshon
  • 52,548
  • 16
  • 116
  • 154