# DynamicWhere Issue

**URL:** https://talk.remobjects.com/t/dynamicwhere-issue/6523
**Category:** Data Abstract
**Created:** [July 9, 2015, 9:23pm UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523 "2015-07-09T21:23:43Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![assetsccok](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/cc9497/32.png) [@assetsccok](https://talk.remobjects.com/u/assetsccok)
#### Post date: [July 9, 2015, 9:23pm UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/1 "2015-07-09T21:23:43Z")

</div>

This code was generated  
WHERE  
(((“VOID” = :DAPARAM\_1) AND (“Member\_Nbr” = :Member\_Nbr)) AND ((“YMDEFF” \<= :As\_Of\_Date) AND (“YMDEND” \>= :As\_Of\_Date)))

From this DynamicWhere  
WhereExpression dynamicWhere;  
dynamicWhere = new BinaryExpression(  
new BinaryExpression(  
new BinaryExpression(  
new FieldExpression(“VOID”),  
new ConstantExpression(" "),  
BinaryOperator.Equal),  
new BinaryExpression(  
new FieldExpression(“Member\_Nbr”),  
new ParameterExpression(“Member\_Nbr”, DataType.WideString, 12),  
BinaryOperator.Equal),  
BinaryOperator.And),  
new BinaryExpression(  
new BinaryExpression(  
new FieldExpression(“YMDEFF”),  
new ParameterExpression(“As\_Of\_Date”, DataType.LargeInt, 0),  
BinaryOperator.LessOrEqual),  
new BinaryExpression(  
new FieldExpression(“YMDEND”),  
new ParameterExpression(“As\_Of\_Date”, DataType.LargeInt, 0),  
BinaryOperator.GreaterOrEqual),  
BinaryOperator.And),  
BinaryOperator.And);  
It errors out with an Oracle error.

Thanks,  
Monte

---

<div class="post-metadata">

### Author: ![antonk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@antonk](https://talk.remobjects.com/u/antonk)
#### Post date: [July 10, 2015, 10:35am UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/2 "2015-07-10T10:35:39Z")

</div>

Hello

Could you say which exactly error did you get and which exactly Data Abstract version is used?

Thanks in advance

---

<div class="post-metadata">

### Author: ![assetsccok](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/cc9497/32.png) [@assetsccok](https://talk.remobjects.com/u/assetsccok)
#### Post date: [July 10, 2015, 12:57pm UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/3 "2015-07-10T12:57:00Z")

</div>

Hey Anton…  
Error was {“ORA-01008: not all variables bound”}  
and I am using the .Net version of DA I think the May build

Why would it be generating DAPARAM\_1 for a constant? And it looks like it is putting quotes around Aliased names and  
even sql developer throws an error on that. Is there a way not to generate the quotes on Aliased columns?  
Thanks,  
Monte

---

<div class="post-metadata">

### Author: ![assetsccok](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/cc9497/32.png) [@assetsccok](https://talk.remobjects.com/u/assetsccok)
#### Post date: [July 10, 2015, 1:37pm UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/4 "2015-07-10T13:37:35Z")

</div>

Anton,

Also a method like NewBinaryExpressionList would be handy in the .Net version like the one in the Delphi WhereBuilder…

Thanks,  
Monte

---

<div class="post-metadata">

### Author: ![antonk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@antonk](https://talk.remobjects.com/u/antonk)
#### Post date: [July 10, 2015, 5:50pm UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/5 "2015-07-10T17:50:02Z")

</div>

Hello

Could you double-check your DataAbstract.daConfig file and say which parameter handling type is set for driver profiles [ODP10g.NET](http://ODP10g.NET) and [ODP9i.NET](http://ODP9i.NET) (somewhere around lines 410-436 in the file)?

Thanks in advance

---

<div class="post-metadata">

### Author: ![assetsccok](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/cc9497/32.png) [@assetsccok](https://talk.remobjects.com/u/assetsccok)
#### Post date: [July 13, 2015, 2:59pm UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/6 "2015-07-13T14:59:26Z")

</div>

```
  <ParameterHandling Type="ByName"
                 SQLSymbol=":"
                 NameSymbol="" />

```

Thanks,  
Monte

---

<div class="post-metadata">

### Author: ![antonk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@antonk](https://talk.remobjects.com/u/antonk)
#### Post date: [July 14, 2015, 9:36am UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/7 "2015-07-14T09:36:44Z")

</div>

Hello

Please update to the May 2015 release. It should contain fix for this issue.

Regards

---

<div class="post-metadata">

### Author: ![assetsccok](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/cc9497/32.png) [@assetsccok](https://talk.remobjects.com/u/assetsccok)
#### Post date: [July 14, 2015, 11:39am UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/8 "2015-07-14T11:39:43Z")

</div>

Anton,

I am running May 2015 8.3.91.1167

Thanks,  
Monte

---

<div class="post-metadata">

### Author: ![antonk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@antonk](https://talk.remobjects.com/u/antonk)
#### Post date: [July 14, 2015, 12:02pm UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/9 "2015-07-14T12:02:13Z")

</div>

Hello

Hmm, this is odd. Maybe your project includes the **DataAbstract.daConfig** file from olderversion of Data Abstract? We have changed parameter handling type for both [ODP10g.NET](http://ODP10g.NET) and [ODP9i.NET](http://ODP9i.NET) type to _Sequential_ while your version of file still contains _ByName_ setting (this can cause issues similar to the ones you have).

---

<div class="post-metadata">

### Author: ![assetsccok](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/cc9497/32.png) [@assetsccok](https://talk.remobjects.com/u/assetsccok)
#### Post date: [July 14, 2015, 1:51pm UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/10 "2015-07-14T13:51:31Z")

</div>

So I should set it to sequential? I’ll give that a try… thanks,  
Monte

---

<div class="post-metadata">

### Author: ![assetsccok](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/cc9497/32.png) [@assetsccok](https://talk.remobjects.com/u/assetsccok)
#### Post date: [July 14, 2015, 2:18pm UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/11 "2015-07-14T14:18:33Z")

</div>

Anton,

I set the ParameterHandling to Sequential and I got the same result. “ORA-01008: not all variables bound”

Here’s the generated DynamicWhere:  
(((YMDEFF \<= :As\_Of\_Date) and (YMDEND \>= :As\_Of\_Date)) and (MEMBER\_NBR = :Member\_Nbr))

Here’s the generated SQL…  
SELECT c.MEMBER\_NBR as “Member\_Nbr”\r\n , c.REGION as “Region\_Code”\r\n , c.VOID\r\n , c.YMDEFF\r\n , c.YMDEND\r\n , c.BUSINESS\_UNIT as “Business\_Unit”\r\n , c.CARRIER as “Carrier”\r\n , c.PROG\_NBR as “Program”\r\n , c.GROUP\_NBR as “Group”\r\n , c.DIVISION\_NBR as “Division”\r\n , h.DESCRIPTION as “Group\_Desc”\r\n , c.BENEFIT\_PKG\r\n , g.NAME\_X as “Region\_Desc”\r\nFROM MEMBER\_S c \r\n LEFT OUTER JOIN SUPER\_T h ON h.SUPER\_KEY = ‘REG’ || c.REGION\r\n LEFT OUTER JOIN GRP\_M g ON c.GROUP\_NBR = g.GROUP\_NBR\r\nWHERE\r\n\tC.VOID = ’ ’ AND\r\n(((“YMDEFF” \<= :As\_Of\_Date) AND (“YMDEND” \>= :As\_Of\_Date)) AND (“Member\_Nbr” = :Member\_Nbr))

That where rendering is incorrect based on the DynamicWhere… It should be MEMBER\_NBR in quotes…

Thanks,  
Monte

---

<div class="post-metadata">

### Author: ![antonk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@antonk](https://talk.remobjects.com/u/antonk)
#### Post date: [July 14, 2015, 3:19pm UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/12 "2015-07-14T15:19:40Z")

</div>

Could you create a testcase for this issue? Client and server apps and a table definition SQL to repro this locally? Send it to support@ and we’ll find out what causes the issue.

Thanks in advance

---

<div class="post-metadata">

### Author: ![assetsccok](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/cc9497/32.png) [@assetsccok](https://talk.remobjects.com/u/assetsccok)
#### Post date: [July 23, 2015, 7:35pm UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/13 "2015-07-23T19:35:57Z")

</div>

Not sure I can do that, but as I’ve investigated this more the following appears to be the underlying issue…

WHERE (YMDEFF \<= :AS\_OF\_DATE) AND (YMDEND \>= :AS\_OF\_DATE) causes the ORA-01008 whether or not I used ByName or Sequential ParameterHandling. To solve this I generated an extra AS\_OF\_DATE parameter and associated it  
with YMDEND in the 2nd binary expression (YMDEND \>= :AS\_OF\_DATE1). It works but it’s definitely more overhead. Oracle supports use of the one parameter by the way. Can we get this to support multiple references to a single parameter please?

Thanks  
Monte H

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [July 23, 2015, 10:07pm UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/14 "2015-07-23T22:07:18Z")

</div>

Thanks, logged as bugs://72573

---

<div class="post-metadata">

### Author: ![antonk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@antonk](https://talk.remobjects.com/u/antonk)
#### Post date: [July 23, 2015, 10:08pm UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/15 "2015-07-23T22:08:47Z")

</div>

Hello

I’ve logged this as a bug for further investigation. Could you please show the initial DynamicWhere expression that was turned into this SQL statement?

Thanks in advance

---

<div class="post-metadata">

### Author: ![assetsccok](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/cc9497/32.png) [@assetsccok](https://talk.remobjects.com/u/assetsccok)
#### Post date: [July 24, 2015, 1:26pm UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/16 "2015-07-24T13:26:05Z")

</div>

Anton…

rendered: {(((YMDEFF = :AS\_OF\_DATE) and (YMDEND = :AS\_OF\_DATE)) and (MEMBER\_NBR = :MEMBER\_NBR))}

original: (YMDEFF=:AS\_OF\_DATE) AND (YMDEND=:AS\_OF\_DATE) AND (MEMBER\_NBR=:MEMBER\_NBR)

---

<div class="post-metadata">

### Author: ![antonk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@antonk](https://talk.remobjects.com/u/antonk)
#### Post date: [July 27, 2015, 9:52am UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/17 "2015-07-27T09:52:06Z")

</div>

Thanks. The bug is logged. Seems the sequential parameter handling procedure assumes that all parameters have distinct names (which is not correct ofc).

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [August 18, 2015, 11:39am UTC](https://talk.remobjects.com/t/dynamicwhere-issue/6523/18 "2015-08-18T11:39:54Z")

</div>

bugs://72573 got closed with status fixed.
