Using In Operator in a query

All your dOOdad needs ...

Using In Operator in a query

Postby KETALS on Thu Mar 01, 2007 8:06 pm

Hi
I am trying to use \"In\" operator in my query the code is as shown below

Me.Aggregate.PERIOD_END_DATE.Function = MyGeneration.dOOdads.AggregateParameter.Func.Max
Me.Where.PORTFOLIO_ID.Value = dealId
Me.Where.CASH_ACTIVITY_DATE.Operator = MyGeneration.dOOdads.WhereParameter.Operand.LessThanOrEqual
Me.Where.CASH_ACTIVITY_DATE.Value = crntDistDate
Me.Where.CASH_ACTIVITY_TYPE.Operator = MyGeneration.dOOdads.WhereParameter.Conj.AND_
Me.Where.CASH_ACTIVITY_TYPE.Value = \"INITIAL FUNDING,Distribution\"
Me.Where.CASH_ACTIVITY_TYPE.Operator = MyGeneration.dOOdads.WhereParameter.Operand.In_
Me.Query.AddGroupBy(\"PORTFOLIO_ID\")
Me.Query.Load()
Return Me.PERIOD_END_DATE

The query looks somewhat like this in a watch window :

SELECT MAX(\"PERIOD_END_DATE\") AS \"PERIOD_END_DATE\" FROM GENESIS.CASH_ACTIVITY_HEADER WHERE PORTFOLIO_ID = :PORTFOLIO_ID1 AND CASH_ACTIVITY_DATE <= :CASH_ACTIVITY_DATE2 AND CASH_ACTIVITY_TYPE IN (INITIAL FUNDING,Distribution) GROUP BY \"PORTFOLIO_ID\"

I am getting following exception : ORA-00936: missing expression

I am not sure why this is happening

Any help is appreciated ?

Thanks
Ketal
KETALS
Lurker
 
Posts: 7
Joined: Wed Jan 17, 2007 12:22 am

Postby mgnoonan on Thu Mar 01, 2007 9:06 pm

If CASH_ACTIVITY_TYPE is a varchar2, then I think you need to enclose your values in quotes:

Code: Select all
Me.Where.CASH_ACTIVITY_TYPE.Value = \"'INITIAL FUNDING','Distribution'\"
Matt Noonan
EasyObjects.NET - The O/RM for the Enterprise Library
http://www.easyobjects.net
User avatar
mgnoonan
Expert
 
Posts: 1019
Joined: Tue Sep 14, 2004 3:17 am
Location: Springboro, OH


Return to dOOdads - MyGeneration's .NET Architecture

Who is online

Users browsing this forum: Google [Bot] and 0 guests

cron