# Problem using Lookups

**URL:** <https://forum.cloverdx.com/t/problem-using-lookups/586>\
**Category:** CloverDX Platform\
**Created:** [September 9, 2009, 12:00am UTC](https://forum.cloverdx.com/t/problem-using-lookups/586 "2009-09-09T00:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ciscochi](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@ciscochi](https://forum.cloverdx.com/u/ciscochi)\
**Post date:** [September 9, 2009, 12:00am UTC](https://forum.cloverdx.com/t/problem-using-lookups/586/1 "2009-09-09T00:00:00Z")

</div>

Hi,  
I’ve searched the forum but didn’t see anything with this very basic problem, so I suspect it is something I am missing from the user guide.

I am having trouble with DB Lookups. I’ve defined a DB lookup a few different ways:  
- query like: select \* from dim  
- query like: select name, id from dim  
- no metadata  
- metadata with name, id

I’m unable to reference this lookup. In my reformat, I do:  
lookup(LookupTable0, $0.name).id

When I run the graph, I get the following error:  
Interpreter runtime exception on line 20 column 51 : java.sql.SQLException: Parameter index out of range (1 \> number of parameters, which is 0). with field ‘\_field0’ when mapping…

In other tools, I have to specify a key, but I didn’t see where I specified this.

What am I doing wrong?

\*\*\* One gripe I have about lookups is that I don’t see a way to change the ID, which is what is used in all the references to it. I don’t understand why we don’t just use the logical names to reference the lookups, like Ab Initio.

---

<div class="post-metadata">

**Author:** ![ciscochi](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@ciscochi](https://forum.cloverdx.com/u/ciscochi)\
**Post date:** [September 10, 2009, 6:43am UTC](https://forum.cloverdx.com/t/problem-using-lookups/586/2 "2009-09-10T06:43:09Z")

</div>

I figured this one out. The picture in the user guide was tiny, but I noticed after posting.

I’m not sure if this implementation of DB lookup is very performant. I got 3x better throughput by implementing a hash join with the lookup as an input table in the slave port.
