# Return LookUp Value

**URL:** <https://forum.cloverdx.com/t/return-lookup-value/899>\
**Category:** CloverDX Platform\
**Created:** [July 26, 2011, 12:00am UTC](https://forum.cloverdx.com/t/return-lookup-value/899 "2011-07-26T00:00:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![indu](https://avatars.discourse-cdn.com/v4/letter/i/eada6e/32.png) [@indu](https://forum.cloverdx.com/u/indu)\
**Post date:** [July 26, 2011, 12:00am UTC](https://forum.cloverdx.com/t/return-lookup-value/899/1 "2011-07-26T00:00:00Z")

</div>

Hi,  
I am trying to do a look up on a table (Product table, having columns Product\_key,Product\_code) using a code (say Product\_code) coming from a input file.  
After the lookup i want to return the primary key(Product\_key).

Please tell me which component should i use. I tried using LookupJoin but i couldn’t find where do i specify the return value(Product\_key).

Much Thanks,  
Indu

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [July 27, 2011, 8:27am UTC](https://forum.cloverdx.com/t/return-lookup-value/899/2 "2011-07-27T08:27:15Z")

</div>

Hello Indu,  
lookup table serves as virtual port in LookupJoin component, so to refer the data use just notation as for 1st input port: $1.fieldName (see attached graph as example).

- [LookupJoin.grf](https://cdn.cloverdx.com/forum/417%5F4acb0a82a1d911a1e2860ea4ceb09060/LookupJoin.grf)

---

<div class="post-metadata">

**Author:** ![indu](https://avatars.discourse-cdn.com/v4/letter/i/eada6e/32.png) [@indu](https://forum.cloverdx.com/u/indu)\
**Post date:** [July 27, 2011, 9:26am UTC](https://forum.cloverdx.com/t/return-lookup-value/899/3 "2011-07-27T09:26:42Z")

</div>

Hi Agata,

Tried to create a graph following your graph. The graph is running successfully but there are no outputs!  
The data source field seems to be empty in your graph. Is that the problem that i am not getting the output??  
Also the Data Source tab takes FileURL, is there any way that i can connect to the DB by giving connection details (like host name/username/password)?

Thanks,  
Indu

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [July 27, 2011, 10:11am UTC](https://forum.cloverdx.com/t/return-lookup-value/899/4 "2011-07-27T10:11:12Z")

</div>

Hello Indu,  
you need to pre-fill the lookup table with data of course. You have a few possibilities:

- use [DBJoin](http://www.cloveretl.com/documentation/UserGuide/topic/com.cloveretl.gui.docs/docs/dbjoin.html) instead of LookupJoin

- use [DBLookup](http://www.cloveretl.com/documentation/UserGuide/topic/com.cloveretl.gui.docs/docs/database-lookup-table.html) instead of SimpleLookup  
In both above cases your query should look something like:  
_select \* from “Product table” where Product\_code = ?_

- Pre-fill your lookup table with DBInputTable → [LookupTableReaderWriter](http://www.cloveretl.com/documentation/UserGuide/topic/com.cloveretl.gui.docs/docs/lookuptablereaderwriter.html)

---

<div class="post-metadata">

**Author:** ![indu](https://avatars.discourse-cdn.com/v4/letter/i/eada6e/32.png) [@indu](https://forum.cloverdx.com/u/indu)\
**Post date:** [August 2, 2011, 9:13am UTC](https://forum.cloverdx.com/t/return-lookup-value/899/5 "2011-08-02T09:13:43Z")

</div>

Thanks Agata,  
It worked with DBLookup 🙂
