ExecuteStoreQuery Parameters

ExecuteStoreQuery Parameters

Postby WitekB » Fri 26 Mar 2010 12:08

Hi All!

I've got an problem with adding parameters to ExecuteStoreQuery, I've always got an message "ORA-00936: missing expression"

I was using this code

Code: Select all
object[] Parameters =
                        {
                             new Devart.Data.Oracle.OracleParameter{ ParameterName = "@SysPRPRODUCT", Value = sysPrProdukt},
                             new Devart.Data.Oracle.OracleParameter{ ParameterName = "@SysBRAND", Value = ServiceValidator.SysBRAND},
                             new Devart.Data.Oracle.OracleParameter{ ParameterName = "@SysOBType", Value = sysObTyp},
                             new Devart.Data.Oracle.OracleParameter{ ParameterName = "@SysPRKGroup", Value = SysPRKGroup},
                             new Devart.Data.Oracle.OracleParameter{ ParameterName = "@SysPRHGroup", Value = PrHGroup.SYSPRHGROUP}
                         };
                       
                       
PrParamList = context.ExecuteStoreQuery("SELECT * FROM TABLE(CIC.CIC_PRISMA_UTILS.DeliverAvalPrParam(@SysPRPRODUCT, @SysBRAND, @SysOBType , @SysPRKGroup, @SysPRHGroup))", Parameters).ToList();

I'm using dotConnect for Oracle 5.60 Beta Professional Trial, any support would be appreciated
WitekB
 
Posts: 3
Joined: Fri 26 Mar 2010 12:01

Postby AndreyR » Mon 29 Mar 2010 11:57

I have tried to use the similar code and succeeded. However, I used ":" placeholder for parameters and passed names without "@", like in the following example:
Code: Select all
object[] Parameters =
  {
     new Devart.Data.Oracle.OracleParameter{ ParameterName = "doc_id", Value = 1},
     new Devart.Data.Oracle.OracleParameter{ ParameterName = "user_id", Value = 2}
  };
var q = context.ExecuteStoreQuery("SELECT * FROM TABLE(REFCURSORRETFUNCPIPE(:doc_id, :user_id))", Parameters).ToList();

If the problem persists, please send me the script of the objects you are using in the query.
Last edited by AndreyR on Fri 09 Apr 2010 10:00, edited 1 time in total.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby WitekB » Thu 08 Apr 2010 13:28

Thanks, it resolved problem :)
WitekB
 
Posts: 3
Joined: Fri 26 Mar 2010 12:01


Return to dotConnect for Oracle