# Select table count into a parameter

**URL:** <https://forum.cloverdx.com/t/select-table-count-into-a-parameter/1511>\
**Category:** CloverDX Platform\
**Created:** [November 4, 2014, 12:00am UTC](https://forum.cloverdx.com/t/select-table-count-into-a-parameter/1511 "2014-11-04T00:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bxy](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.cloverdx.com/bxy/32/97_2.png) [@bxy](https://forum.cloverdx.com/u/bxy)\
**Post date:** [November 4, 2014, 12:00am UTC](https://forum.cloverdx.com/t/select-table-count-into-a-parameter/1511/1 "2014-11-04T00:00:00Z")

</div>

Hi,

I’m new on Clover, and I was trying to pass the count of one table into a graph parameter (i.e. $count) then use that parameter to do further logic check.  
However I tried many ways (including DBExecute and DBInputTable) and always get error like “Optimizing connection failed: The CLOSE\_CURSORS\_AT\_COMMIT option is not currently supported by the setHoldability method.”

Let’s assume the count query is: select count(\*) from table1 where condition1=‘A’  
and I want the value to be passed to $count.

Would you please advise how I should do it?

In SSIS I use to have: Select “count”=count(\*) from table1 where condition1=‘A’, but this doesn’t seem to work here.

Thanks a lot

---

<div class="post-metadata">

**Author:** ![hparsa](https://avatars.discourse-cdn.com/v4/letter/h/8baadc/32.png) [@hparsa](https://forum.cloverdx.com/u/hparsa)\
**Post date:** [November 4, 2014, 8:10pm UTC](https://forum.cloverdx.com/t/select-table-count-into-a-parameter/1511/2 "2014-11-04T20:10:40Z")

</div>

Hi,

You cannot dynamically assign values to parameters in a graph unless you pass it from a jobflow that calls your graph. Instead you can define a dictionary. So get the count and in an immediate Reformat component assign the count value to a dictionary. Remember you can use the value of that dictionary only in the same (if connected by an edge after assignment) or later phases.

Data input table:

select $COUNT:=count(\*) from table1 where condition1=‘A’

Reformat:

dictionary.COUNT=$in.0.COUNT;

- [TEST\_COUNT\_DICTIONARY.grf](https://cdn.cloverdx.com/forum/17489%5F9b0a150b6de3c8a9e4537ff8f65240bb/TEST%5FCOUNT%5FDICTIONARY.grf)
